This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 11/11 v5] Remove one GDBSERVER use from linux-waitpid.c
- From: Pedro Alves <palves at redhat dot com>
- To: Gary Benson <gbenson at redhat dot com>, Doug Evans <dje at google dot com>
- Cc: gdb-patches at sourceware dot org, Tom Tromey <tromey at redhat dot com>
- Date: Wed, 20 Aug 2014 16:04:08 +0100
- Subject: Re: [PATCH 11/11 v5] Remove one GDBSERVER use from linux-waitpid.c
- Authentication-results: sourceware.org; auth=none
- References: <1406888377-25795-1-git-send-email-gbenson at redhat dot com> <1406888377-25795-12-git-send-email-gbenson at redhat dot com> <21474 dot 30047 dot 278277 dot 20526 at ruffy dot mtv dot corp dot google dot com> <20140807123859 dot GB19737 at blade dot nx>
On 08/07/2014 01:38 PM, Gary Benson wrote:
> Doug Evans wrote:
>> Gary Benson writes:
>> > @@ -35,6 +29,8 @@ static inline void
>> > linux_debug (const char *format, ...)
>> > {
>> > #ifdef GDBSERVER
>> > + extern int debug_threads;
>> > +
>>
>> Recognizing that this is a temporary hack, ok by me.
>> Can I ask you to add a FIXME here though?
>
> I added:
>
> /* FIXME: This conditional code and hacky extern are necessary now,
> but should be removed when GDB's and gdbserver's Linux thread_db
> implementations are unified and moved into the nat directory. */
No.
This file (linux-waitpid.c) really has nothing to do with thread_db
(glibc interface). It's part of the kernel/ptrace layer.
If we wanted this particular debug output enabled on GDB, then it'd
be guarded by 'debug_linux_nat' (set debug lin-lwp 1). There's really
no good reason for GDB and GDBserver to be different here, other than
the history of this waitpid wrapper and how it ended up used in gdb
as well.
The "threads" in "debug_threads" in gdbserver is just a historic wart.
That global really means "global/generic debug traces enabled".
It was the only debug flag that existed in gdbserver for a long
while, and nobody ever renamed it.
--
Thanks,
Pedro Alves