From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: nick.hudson@dsl.pipex.com
Cc: gdb@sourceware.org
Subject: Re: threads and core file support
Date: Sat, 22 Dec 2007 14:14:00 -0000 [thread overview]
Message-ID: <200712221414.lBMEE3aG000537@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <200712221317.22469.nick.hudson@dsl.pipex.com> (message from Nick Hudson on Sat, 22 Dec 2007 13:17:21 +0000)
> 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
prev parent reply other threads:[~2007-12-22 14:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-22 13:17 Nick Hudson
2007-12-22 14:14 ` Mark Kettenis [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200712221414.lBMEE3aG000537@brahms.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=gdb@sourceware.org \
--cc=nick.hudson@dsl.pipex.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox