public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: Todd.Kneisel@Bull.com, gdb@sources.redhat.com
Subject: Re: gdb6.0 and statically linked threaded programs
Date: Fri, 24 Oct 2003 21:01:00 -0000	[thread overview]
Message-ID: <3F999316.6050805@gnu.org> (raw)
In-Reply-To: <20031023203554.GA12733@nevyn.them.org>

> On Wed, Oct 22, 2003 at 03:59:53PM -0700, Todd.Kneisel@Bull.com wrote:
> 
>> I have built gdb6.0 and am having trouble using it to debug a
>> threaded program that is statically linked with the linuxthreads
>> pthread library. Gdb does not detect the creation of threads,
>> it traps signal 32 that the pthread library uses to restart
>> threads, and gets a SIGINT instead of stopping at a breakpoint
>> in a thread.
>> 
>> If I dynamically link my program, everything works fine. For
>> a number of reasons, I need to link my program statically.
>> 
>> I've begun looking at the gdb code and found the following
>> text in a comment in the thread_db_mourn_inferior function:
>> 
>>    At present,
>>    debugging a statically-linked threaded program is broken, but
>>    the check is added below in the event that it is fixed in the
>>    future.
>> 
>> Is anyone working on fixing this?  Or can anyone provide more
>> details about how or why it's broken?
> 
> 
> It's broken because the thread layer is never initialized.  I'm waiting
> for some of the changes to the target stack to see if they make it
> easier to fix this - the last few things I've tried were simply gross
> beyond words.

Daniel, suggest looking at:
interface VS target (or something else wrong with the target vector)
http://sources.redhat.com/ml/gdb/2003-10/msg00218.html

The implication is that immediatly after attaching to a process (or 
corefile) there'd be some sort of broadcast message telling any 
interested parties (thread stratum, overlay stratum, shlibs, ...) that 
there's a fresh new process/core to push onto.

But as you note, it will require some pushing and shoving to get there.

Andrew


  reply	other threads:[~2003-10-24 21:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-23 20:34 Todd.Kneisel
2003-10-23 20:35 ` Daniel Jacobowitz
2003-10-24 21:01   ` Andrew Cagney [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-10-25  0:09 Todd.Kneisel
2003-10-22 23:00 Todd.Kneisel
2003-10-23 12:24 ` Daniel Jacobowitz

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=3F999316.6050805@gnu.org \
    --to=cagney@gnu.org \
    --cc=Todd.Kneisel@Bull.com \
    --cc=drow@mvista.com \
    --cc=gdb@sources.redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).