This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: "run", and executable file/symtab association?
- From: Randolph Chung <randolph at tausq dot org>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: msnyder at redhat dot com, gdb at sources dot redhat dot com
- Date: Sat, 18 Feb 2006 17:53:56 +0800
- Subject: Re: "run", and executable file/symtab association?
- References: <dsu1q7$93m$1@sea.gmane.org> <20060215030909.GB8700@nevyn.them.org>
If kill_inferior calls pop_target it'd better be expecting to close a
native target, not the exec target further down the stack. This looks
like a bug in the checkpoint code somewhere. Ugh, the bits in
kill_inferior are a little scary. First thing to do: figure out what's
on the target stack (follow current_target.beneath), and why it's got
execution if it's popping exec_close.
The target stack looks like:
(top-gdb) print current_target->to_shortname
$2 = 0x334298 "child"
(top-gdb) print current_target->beneath->to_shortname
$3 = 0x334298 "child"
(top-gdb) print current_target->beneath->beneath->to_shortname
$4 = 0x2d7d6c "exec"
(top-gdb) print current_target->beneath->beneath->beneath->to_shortname
$5 = 0x312614 "None"
And to_close is:
(top-gdb) print current_target->to_close
$6 = (void (*)(int)) @0x38465a: 0x47954 <exec_close>
kill_inferior() says:
/* First cut -- let's crudely do everything inline. */
if (forks_exist_p ())
{
linux_fork_killall ();
pop_target ();
generic_mourn_inferior ();
}
else
{
...
}
I don't pretend to understand this code and why if there are forks, we
should be popping the target to kill everything.
Michael Snyder added/changed this when he checked in the checkpoint
code, perhaps he can comment?
randolph