Re: [PATCH 2/4] gdbserver: Don't add extra NULL to program args

Michael Weghorn
2020-05-12T16:00:38Z

On 07/05/2020 21.54, Simon Marchi wrote:
> On 2020-04-29 7:16 a.m., Michael Weghorn via Gdb-patches wrote:
>> The vector holding the program args is passed as a parameter
>> to target_create_inferior, which then passes it to
>> stringify_argv for all platforms, where any NULL entry in
>> the vector is ignored, so there seems to be no reason
>> to actually add one after all.
>>
>> (Since the intention is to replace uses of stringify_argv with
>> construct_inferior_arguments in a follow-up commit and that
>> function doesn't currently handle such NULL arguments, it
>> would otherwise have to be extended.)
>
> Thanks, this LGTM.

I actually missed another occurence where the same was done and have
removed that as well in the next version:
https://sourceware.org/pipermail/gdb-patches/2020-May/168348.html

This was the cause of the segfault you had encountered and mentioned for
the next patch.

Michael