This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH RFA] Propagate signals to non-clone PID on GNU/Linux
- From: Mark Kettenis <kettenis at chello dot nl>
- To: kevinb at redhat dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sun, 31 Mar 2002 17:36:37 +0200 (CEST)
- Subject: Re: [PATCH RFA] Propagate signals to non-clone PID on GNU/Linux
- References: <1020328075921.ZM25566@localhost.localdomain>
Hi Kevin,
Hmm, there are a couple of things that make me doubt that this is the
right solution.
Please realize that lin-lwp.c:child_wait() is used for all Linux
processes, not only multi-threaded programs. Therefore I'm not very
enthousiastic about adding too much overhead to this function,
including setting up and manipulating GDB's internal LWP bookkeeping.
Actually, I think the patch in its current incarnation introduces a
memory leak: when debugging normal programs, GDB will keep adding
LWP's to its internal bookkeeping and never remove them.
Unfortunately I can't think of another way to fix the bug with the
"cloned" flag being set incorrectly for the LWP that GDB initially
attached to. Perhaps the use of a static global variable is justified
in this case?
I'm a bit confused by the name you've chosen for
set_up_clone_as_overall_process_id(), since it should never be called
for a "cloned" process isn't it. Can you find a better name?
I was also confused why you removed the code that "handles the overall
process being stopped in another layer" in lin_lwp_attach_lwp(), but
of course that is related to what you did to child_wait(). If we
agree that using a global variable in child_wait() is the right
approach, this bit is where the "cloned" flag should be set based on
the setting of that global variable.
Mark