From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb@sourceware.org
Subject: Re: Debugging through exec() (Linux MAY_FOLLOW_EXEC)
Date: Tue, 15 Aug 2006 14:28:00 -0000 [thread overview]
Message-ID: <20060815142819.GA26405@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <u3bby65ua.fsf@gnu.org>
On Tue, 15 Aug 2006 05:22:21 +0200, Eli Zaretskii wrote:
> Daniel Jacobowitz wrote:
> > Eli, have you got an opinion on the broader question, by chance?
...
> The thing is, I couldn't figure out the broader context of this
> suggested change, from what was posted. There's not enough info;
Currently gdb does not notice `exec' at all - it does not apply the inferior
changes to its debugging information about the inferior. By default in the
point of `exec' it will lose any breakpoints and the execution will continue
without any gdb influence and the program will just finish uncaught.
If you turn on "catch exec" you will get back the control after `exec' changes
the virtual memory context but gdb will still expect the original executable is
still loaded. All the sources will be displayed for the original program and
breakpoints put to the addresses according to the debuginfo of the original
program, still everything will be messed up as a complately different
executable is already running.
In fact the original intention of this patch was different - gdb locked up on
any `exec' from a threaded program.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=182116
Cannot find user-level thread for LWP 4256: generic error
it was fixed by a more simple way by Daniel, though:
2006-07-24 Jan Kratochvil <jan.kratochvil@redhat.com>
Daniel Jacobowitz <dan@codesourcery.com>
* linux-thread-db.c (thread_db_wait): Remove libthread_db
after exec events.
So I no longer consider this patch as mission critical as before. Still it is
useful for debugging programs like javac(1) or gcc(1) which are in fact only
wrappers. Some years ago I had to always watch (usually using strace(1)) which
next program gets executed and restart the debugging from the spawned process
with the found arguments and environment variables. This patch will just
simplify it, do not care whether this program is the final one or just the
spawning stub, just run it through gdb and catch the problematic point.
And from the principal point - currently (without this patch) "catch exec"
command is just broken - after it catches `exec' the state of the debugger and
the debugging program is inconsistent.
Thanks for the interest,
Jan
next prev parent reply other threads:[~2006-08-15 14:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060614142552.GA15021@nevyn.them.org>
[not found] ` <20060615203519.GA9603@host0.dyn.jankratochvil.net>
[not found] ` <20060721181556.GA9150@lace.redhat.com>
[not found] ` <20060721184421.GA22820@nevyn.them.org>
[not found] ` <20060722123102.GA1936@lace.redhat.com>
[not found] ` <20060724190332.GA13612@nevyn.them.org>
[not found] ` <20060729185317.GA16200@host0.dyn.jankratochvil.net>
[not found] ` <200607312038.k6VKchKj018729@elgar.sibelius.xs4all.nl>
[not found] ` <20060805164144.GA23819@host0.dyn.jankratochvil.net>
[not found] ` <20060808160113.GC21032@nevyn.them.org>
2006-08-14 15:07 ` Jan Kratochvil
2006-08-14 21:20 ` Eli Zaretskii
2006-08-14 21:39 ` Daniel Jacobowitz
2006-08-15 3:22 ` Eli Zaretskii
2006-08-15 14:28 ` Jan Kratochvil [this message]
2006-08-18 12:27 ` Eli Zaretskii
2006-09-04 17:59 ` Jan Kratochvil
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=20060815142819.GA26405@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=eliz@gnu.org \
--cc=gdb@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