Re: [RFC PATCH] gdbstub: Re-factor gdb command extensions

2024-07-17 Thread Peter Maydell
On Tue, 16 Jul 2024 at 22:53, Richard Henderson wrote: > > On 7/17/24 02:55, Alex Bennée wrote: > >> Are you expecting the same GdbCmdParseEntry object to be registered > >> multiple times? Can we fix that at a higher level? > > > > Its basically a hack to deal with the fact everything is tied to

Re: [RFC PATCH] gdbstub: Re-factor gdb command extensions

2024-07-17 Thread Alex Bennée
Richard Henderson writes: > On 7/17/24 02:55, Alex Bennée wrote: >>> Are you expecting the same GdbCmdParseEntry object to be registered >>> multiple times? Can we fix that at a higher level? >> Its basically a hack to deal with the fact everything is tied to the >> CPUObject so we register ever

Re: [RFC PATCH] gdbstub: Re-factor gdb command extensions

2024-07-16 Thread Richard Henderson
On 7/17/24 02:55, Alex Bennée wrote: Are you expecting the same GdbCmdParseEntry object to be registered multiple times? Can we fix that at a higher level? Its basically a hack to deal with the fact everything is tied to the CPUObject so we register everything multiple times. We could do a if

Re: [RFC PATCH] gdbstub: Re-factor gdb command extensions

2024-07-16 Thread Alex Bennée
Richard Henderson writes: > On 7/16/24 21:42, Alex Bennée wrote: >> void gdb_extend_qsupported_features(char *qsupported_features) >> { >> -/* >> - * We don't support different sets of CPU gdb features on different >> CPUs yet >> - * so assert the feature strings are the same on

Re: [RFC PATCH] gdbstub: Re-factor gdb command extensions

2024-07-16 Thread Richard Henderson
On 7/16/24 21:42, Alex Bennée wrote: void gdb_extend_qsupported_features(char *qsupported_features) { -/* - * We don't support different sets of CPU gdb features on different CPUs yet - * so assert the feature strings are the same on all CPUs, or is set only - * once (1 CPU).

Re: [RFC PATCH] gdbstub: Re-factor gdb command extensions

2024-07-16 Thread Gustavo Romero
Hi Peter, On 7/16/24 11:09 AM, Peter Maydell wrote: On Tue, 16 Jul 2024 at 14:48, Alex Bennée wrote: Gustavo Romero writes: Hi Alex, On 7/16/24 8:42 AM, Alex Bennée wrote: Coverity reported a memory leak (CID 1549757) in this code and its admittedly rather clumsy handling of extending th

Re: [RFC PATCH] gdbstub: Re-factor gdb command extensions

2024-07-16 Thread Peter Maydell
On Tue, 16 Jul 2024 at 14:48, Alex Bennée wrote: > > Gustavo Romero writes: > > > Hi Alex, > > > > On 7/16/24 8:42 AM, Alex Bennée wrote: > >> Coverity reported a memory leak (CID 1549757) in this code and its > >> admittedly rather clumsy handling of extending the command table. > >> Instead of

Re: [RFC PATCH] gdbstub: Re-factor gdb command extensions

2024-07-16 Thread Alex Bennée
Gustavo Romero writes: > Hi Alex, > > On 7/16/24 8:42 AM, Alex Bennée wrote: >> Coverity reported a memory leak (CID 1549757) in this code and its >> admittedly rather clumsy handling of extending the command table. >> Instead of handing over a full array of the commands lets use the >> lighter w

Re: [RFC PATCH] gdbstub: Re-factor gdb command extensions

2024-07-16 Thread Gustavo Romero
Hi Alex, On 7/16/24 8:42 AM, Alex Bennée wrote: Coverity reported a memory leak (CID 1549757) in this code and its admittedly rather clumsy handling of extending the command table. Instead of handing over a full array of the commands lets use the lighter weight GPtrArray and simply test for the

[RFC PATCH] gdbstub: Re-factor gdb command extensions

2024-07-16 Thread Alex Bennée
Coverity reported a memory leak (CID 1549757) in this code and its admittedly rather clumsy handling of extending the command table. Instead of handing over a full array of the commands lets use the lighter weight GPtrArray and simply test for the presence of each entry as we go. This avoids compli