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
- [PATCH v2 07/14] target/m68k: use gdb_get_reg helpers Alex Bennée
- Re: [PATCH v2 07/14] target/m68k: use gdb_get_reg h... Laurent Vivier
- [PATCH v2 10/14] target/arm: explicitly encode regnum i... Alex Bennée
- [PATCH v2 12/14] target/arm: generate xml description of... Alex Bennée
- Re: [PATCH v2 12/14] target/arm: generate xml descr... Richard Henderson
- [PATCH v2 09/14] target/arm: prepare for multiple dynam... Alex Bennée
- Re: [PATCH v2 09/14] target/arm: prepare for multip... Richard Henderson
- [PATCH v2 14/14] tests/tcg: add a gdbstub testcase for S... Alex Bennée
- [PATCH v2 02/14] gdbstub: stop passing GDBState * around... Alex Bennée
- Re: [PATCH v2 02/14] gdbstub: stop passing GDBState... Richard Henderson
- Re: [PATCH v2 02/14] gdbstub: stop passing GDBState... Damien Hedde
- [PATCH v2 13/14] tests/guest-debug: add a simple test r... Alex Bennée
- Re: [PATCH v2 13/14] tests/guest-debug: add a simpl... Richard Henderson
- [PATCH v2 11/14] target/arm: default SVE length to 64 by... Alex Bennée
- Re: [PATCH v2 11/14] target/arm: default SVE length... Richard Henderson
- Re: [PATCH v2 11/14] target/arm: default SVE le... Alex Bennée
- Re: [PATCH v2 11/14] target/arm: default SV... Richard Henderson
- Re: [PATCH v2 11/14] target/arm: defaul... Alex Bennée
- Re: [PATCH v2 00/14] gdbstub refactor and SVE support no-reply