qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 02/14] gdbstub: stop passing GDBState * around and use glo


From: Damien Hedde
Subject: Re: [PATCH v2 02/14] gdbstub: stop passing GDBState * around and use global
Date: Mon, 2 Dec 2019 16:25:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0


On 11/30/19 9:45 AM, Alex Bennée wrote:
> We only have one GDBState which should be allocated at the time we
> process any commands. This will make further clean-up a bit easier.
> 
> Signed-off-by: Alex Bennée <address@hidden>
> ---
>  gdbstub.c | 539 +++++++++++++++++++++++++++---------------------------
>  1 file changed, 267 insertions(+), 272 deletions(-)
> 

> @@ -2919,33 +2914,33 @@ static void gdb_read_byte(GDBState *s, uint8_t ch)> 
> [...]
>              } else {
>                  /* send ACK reply */
>                  reply = '+';
> -                put_buffer(s, &reply, 1);
> -                s->state = gdb_handle_packet(s, s->line_buf);
> +                put_buffer(&reply, 1);
> +                gdbserver_state.state = gdb_handle_packet(s, 
> gdbserver_state.line_buf);

Is there a reason to keep the GDBState* first parameter in
gdb_handle_packet() ?

There is a few remaining functions still taking GDBState* parameter
+ gdb_handle_packet
+ run_cmd_parser
+ gdb_monitor_output
+ create_default_processes
+ create_processes
+ gdb_read_byte

We should probably clean them too, but otherwise it looks good.

--
Damien



reply via email to

[Prev in Thread] Current Thread [Next in Thread]