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

2019-12-02 Thread Damien Hedde



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 
> ---
>  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, , 1);
> -s->state = gdb_handle_packet(s, s->line_buf);
> +put_buffer(, 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



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

2019-12-01 Thread Richard Henderson
On 11/30/19 8: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 
> ---
>  gdbstub.c | 539 +++---
>  1 file changed, 267 insertions(+), 272 deletions(-)

Reviewed-by: Richard Henderson 

r~