This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH RFA] Propagate signals to non-clone PID on GNU/Linux


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]