This is the mail archive of the gdb-patches@sourceware.org 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 11/11 v5] Remove one GDBSERVER use from linux-waitpid.c


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


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