[PATCH 4/4] [PR gdbserver/25893]: Add gdbserver test for argument with space in it

Michael Weghorn m.weghorn@posteo.de
Tue May 12 16:20:57 GMT 2020


On 11/05/2020 17.04, Simon Marchi wrote:
> On 2020-05-11 10:33 a.m., Michael Weghorn wrote:
>> These don't work yet with the last patch series. I'll recheck once I
>> have finished updating the patch series and in particular fixed the
>> segfault you mentioned earlier.
>>
>> I hope to be able to send an updated patch series tomorrow.
>>
>> Do I understand correctly that I can just drop my patch adding the test,
>> since this is now already covered in a better way by the test case added
>> in your second patch?
> 
> I think so.  You can insert my two patches in your series, as the test depends
> on the fix.
> 
> If you haven't found already: after running the `make check` commands, the
> transcript is found in testsuite/gdb.log.

Thanks a lot, in particular also for your previous explanations of how
those things work together and how to run the various configurations.
Those really helped in finding out what was going wrong.

The problem was that 'handle_v_run' in 'gdbserver/server.cc' already had
some special handling for empty args, passing them as "''" into the arg
vector, and 'construct_inferior_arguments' then took this as a literal
string, so the output of the empty argv[2] was "''" instead of "".

I adapted this in the new version of that patch:
https://sourceware.org/pipermail/gdb-patches/2020-May/168350.html

All of

  make check TESTS="gdb.base/inferior-args.exp"
RUNTESTFLAGS="--target_board=native-gdbserver"

  make check TESTS="gdb.base/inferior-args.exp"
RUNTESTFLAGS="--target_board=unix"

  make check TESTS="gdb.base/inferior-args.exp"
RUNTESTFLAGS="--target_board=native-extended-gdbserver"

now pass for me on linux-amd64 (Debian testing) with the new patch set
and your two commits on top.

I did not explicitly add your commits in the patch series I sent, just
applied them locally (since I was uncertain of how to properly handle
the mismatch between you being the patch author and myself being the
submitter/email sender).

Michael


More information about the Gdb-patches mailing list