Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* threads and core file support
@ 2007-12-22 13:17 Nick Hudson
  2007-12-22 14:14 ` Mark Kettenis
  0 siblings, 1 reply; 2+ messages in thread
From: Nick Hudson @ 2007-12-22 13:17 UTC (permalink / raw)
  To: gdb

Hi,

I'm (slowly) working on improving NetBSD pthreads and core file support and it 
appears to me the best (only?) example to follow is sol-thread.c. 

Is this correct? 

Are there things in sol-thread.c that shouldn't be done anymore?

Thanks,
Nick


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: threads and core file support
  2007-12-22 13:17 threads and core file support Nick Hudson
@ 2007-12-22 14:14 ` Mark Kettenis
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Kettenis @ 2007-12-22 14:14 UTC (permalink / raw)
  To: nick.hudson; +Cc: gdb

> From: Nick Hudson <nick.hudson@dsl.pipex.com>
> Date: Sat, 22 Dec 2007 13:17:21 +0000
> 
> Hi,
> 
> I'm (slowly) working on improving NetBSD pthreads and core file
> support and it appears to me the best (only?) example to follow is
> sol-thread.c.

That code is old and hasn't been properly maintained for years; I
wouldn't recommend using it as a guideline.  It also uses
libthreads_db, which makes building a cross-debugger almost impossible
and complicates matters unecessary for 1:1 threading models.

The Linux threading code suffers from the same problem, but is in many
respects even worse, because the Linux kernel lacked a proper threads
debugging interface for quite a while and the code was written towards
an evolving kernel interface.

My recommendation is to start working on making GDB aware of LWPs (I
think that's how kernel-level threads are called on NetBSD).  You'll
probably need to write a NetBSD-specific replacement for inf-ptrace.c
for that.  I recommend looking at inf-ttrace.c for an example on how
to handle multiple threads.

Then, after that, you might want the add a layer to link LWPs to
user-level threads.  For a pthreads library that uses a 1:1 threading
model this can be as simple as annotating all threads with the
pthread_t identifier and changing the way GDB will print thread IDs
using that.  For N:M threading models things are probably a bit more
complicated (but even Solaris is moving away from N:M threading).

Cheers,

Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-12-22 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-22 13:17 threads and core file support Nick Hudson
2007-12-22 14:14 ` Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox