public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Todd.Kneisel@Bull.com
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb@sources.redhat.com
Subject: Re: gdb6.0 and statically linked threaded programs
Date: Thu, 23 Oct 2003 20:34:00 -0000	[thread overview]
Message-ID: <OFAFCA76F3.ABD04273-ON07256DC8.00704801-07256DC8.007104EC@az05.bull.com> (raw)


>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.
>
>In the mean time I recommend using gdbserver instead of native gdb.
>
>--
>Daniel Jacobowitz
>MontaVista Software                         Debian GNU/Linux Developer

I just tried gdbserver and it's broken worse than native gdb. For both
statically and dynamically linked threaded programs, gdbserver fails
the same way that native gdb does for statically linked programs.

Todd Kneisel.





             reply	other threads:[~2003-10-23 20:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-23 20:34 Todd.Kneisel [this message]
2003-10-23 20:35 ` Daniel Jacobowitz
2003-10-24 21:01   ` Andrew Cagney
  -- 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=OFAFCA76F3.ABD04273-ON07256DC8.00704801-07256DC8.007104EC@az05.bull.com \
    --to=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).