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 <alex.ben...@linaro.org>
> ---
>  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