From: "Doug Evans" <dje@google.com>
To: gdb-patches@sourceware.org
Subject: Re: RFC: Allow a wrapper when starting programs
Date: Sat, 09 Feb 2008 19:20:00 -0000 [thread overview]
Message-ID: <e394668d0802091119q3fd8f78fpda99df49dd8ae07a@mail.gmail.com> (raw)
In-Reply-To: <20080209165328.GA3161@caradoc.them.org>
On Feb 9, 2008 8:53 AM, Daniel Jacobowitz <drow@false.org> wrote:
> Sure. We're waiting for an extra trap for the same reason we
> currently wait for two (on most systems; sometimes varies). We
> normally fork and then execute a command like this one:
>
> sh -c 'exec your-program'
>
> The first trap is generated when gdb execs sh. At this point we know
> where the child is, but it's at the wrong place. The loaded binary is
> sh, not your-program, so we can't set breakpoints in your-program.
>
> With a wrapper, we run:
>
> sh -c 'exec wrapper your-program'
>
> So after two traps, the loaded program is wrapper. If we gave
> control to the user or tried to insert breakpoints at your-program's
> symbols, things would go wrong. We have to wait until the loaded
> program is finally your-program.
>
> There's no portable way to check what the loaded program is, and
> even if there were it wouldn't help enough; wrapper and your-program
> might be the same binary (a corner case, I admit).
When explained this way one might think there are two wrappers: sh and
wrapper. Has anyone ever wanted a way to remove, replace, or
otherwise alter the use of the sh "wrapper"? I realize sh brings
certain functionality to the party, but it seems like one popular use
of the second wrapper is to work around the presence of the first
wrapper. It leaves me wondering if there's a better way. OTOH,
pragmatics may require the proposed implementation.
next prev parent reply other threads:[~2008-02-09 19:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-08 18:57 Daniel Jacobowitz
2008-02-09 8:48 ` Eli Zaretskii
2008-02-09 15:48 ` Daniel Jacobowitz
2008-02-09 16:41 ` Eli Zaretskii
2008-02-09 16:53 ` Daniel Jacobowitz
2008-02-09 19:20 ` Doug Evans [this message]
2008-02-10 1:15 ` Daniel Jacobowitz
2008-02-11 16:14 ` Daniel Jacobowitz
2008-02-11 19:45 ` Daniel Jacobowitz
2008-02-11 20:30 ` Eli Zaretskii
2008-03-10 23:14 ` Daniel Jacobowitz
2008-02-12 19:46 ` Joel Brobecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e394668d0802091119q3fd8f78fpda99df49dd8ae07a@mail.gmail.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox