[RFC] "gdbserver ... BASENAME_EXE" no longer works (was: "[PATCH 5/6] Share fork_inferior et al with gdbserver")

Joel Brobecker brobecker@adacore.com
Wed Feb 21 03:58:00 GMT 2018


Hello,

I just noticed that the following patch...

    commit 2090129c36c7e582943b7d300968d19b46160d84
    Date:   Thu Dec 22 21:11:11 2016 -0500
    Subject: Share fork_inferior et al with gdbserver

... caused a change of behavior in GDBserver, where the following
no longer works (unless '.' is in your PATH, but for me, that's
not a good idea):

    $ gdbserver  --once :4444 simple_main
    zsh:1: command not found: simple_main
    During startup program exited with code 127.
    Exiting

Prior to the change we we able to start simple_main without problems:

    $ gdbserver --once :4444 simple_main
    Process simple_main created; pid = 26579
    Listening on port 4444

Was that intentional? Reading the revision log, there is no mention
of this, and this was a fairly natural thing to be doing. This also
matches something we do with GDBserver as well, so it would make
the two tools consistent in that regard.

Attached is a preliminary hack meant to help me explore what would
be needed to bring this feature back. If we agree we want the feature
back, and that I'm doing it at the right location, I'll split it,
finish the C++-ification of the execv_argv class, and then resubmit
as an official RFA.

Comments on the code welcome, of course! (I feel like a C++ dummy,
sometimes).

Thanks!

On Thu, Dec 22, 2016 at 10:39:20PM -0500, Sergio Durigan Junior wrote:
> This is the most important (and the biggest, sorry) patch of the
> series.  It moves fork_inferior from gdb/fork-child.c to
> common/common-fork-child.c and makes all the necessary adjustments to
> both GDB and gdbserver to make sure everything works OK.
> [...]

-- 
Joel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-WIP-GDBserver-no-longer-working-when-given-an-execut.patch
Type: text/x-diff
Size: 11891 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20180221/68dafa2e/attachment.bin>


More information about the Gdb-patches mailing list