Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: PILLON Julien <julien.pillon@alyotech.fr>
To: Paul Koning <Paul_Koning@Dell.com>,
	"gdb@sourceware.org" 	<gdb@sourceware.org>
Subject: RE : User level threads debugging with GDB
Date: Fri, 09 Apr 2010 13:04:00 -0000	[thread overview]
Message-ID: <06A7AD4E92172446ADDEB44F8A5D5C101CA8246BF0@ARE01.alyotech.fr> (raw)
In-Reply-To: <D8CEBB6AE9D43848BD2220619A43F326539509@M31.equallogic.com>

Thank you for your answer. 
The fact is that I don't want to make big modification to GDB... So I think  I'll go on implementing a libthread_db (with this method, it will be compatible with future (and previous ?) versions of GDB )
So if I've understood well, if my implementation (td_ta_new, td_thr_get*regs) is correct, the stack printing will be ok with a out of the box GDB ?

And will the atttach mode be ok too or is there some special work to do ?


Julien
________________________________________
De : Paul Koning [Paul_Koning@Dell.com]
Date d'envoi : vendredi 9 avril 2010 12:49
À : PILLON Julien; gdb@sourceware.org
Objet : RE: User level threads debugging with GDB

I've just gone through this for NetBSD...

If your platform has a libthread_db then it seems sensible to use that
and interface GDB to it, as Linux does (or can do; it doesn't seem to do
it in all cases).  If not, then you don't need to create one.  Some
existing files offer various pieces of the answer that you can use.  For
example, dec-threads.c is short and simple but not necessarily a
complete answer.  linux-nat.c is very helpful but a bunch of what it
does exists because of extra work needed on Linux.

Stack printing relies on the register access routines; those have to
work per thread.  If they do then the rest just works.

I found the main changes were in the "wait" and "resume" routines.  In
"wait" because after the wait finishes you want to get the list of
threads and their status, and use the GDB routines that update GDB's
list of threads.  In  "resume" because you need to be able to step and
continue a single thread as well as all threads.

For any given platform, I expect that you'll find parts of the answer in
several of the existing threads support files, but probably not the
whole answer in any one of them.

        paul

> -----Original Message-----
> From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On
> Behalf Of PILLON Julien
> Sent: Friday, April 09, 2010 4:13 AM
> To: gdb@sourceware.org
> Subject: User level threads debugging with GDB
>
> Hi,
> I would like to know the right way to do some user-level threads
> debugging with GDB and I have a few questions :
> First, the main work will be within the libthread_db (especially in
the
> td_ta_new function I guess) but what else must be modified and what
can
> be left as is ?
> Next, how should I implement the stack printing ?
> Is the attach mode altered with this kind of modifications ? And if it
> is, where are the sources to modify ?
>
> regards
>
> Julien


  reply	other threads:[~2010-04-09 13:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09  8:12 PILLON Julien
2010-04-09 10:49 ` Paul Koning
2010-04-09 13:04   ` PILLON Julien [this message]
2010-04-09 13:43     ` RE : " Daniel Jacobowitz
2010-04-09 13:54       ` RE : " PILLON Julien

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=06A7AD4E92172446ADDEB44F8A5D5C101CA8246BF0@ARE01.alyotech.fr \
    --to=julien.pillon@alyotech.fr \
    --cc=Paul_Koning@Dell.com \
    --cc=gdb@sourceware.org \
    /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