Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Jan Kratochvil <jan.kratochvil@redhat.com>, gdb-patches@sourceware.org
Subject: Re: RFC: Ignore TLS symbols for non-TLS programs
Date: Sat, 26 Aug 2006 11:56:00 -0000	[thread overview]
Message-ID: <20060825134750.GA5857@nevyn.them.org> (raw)
In-Reply-To: <20060825034301.GA24479@nevyn.them.org>

On Thu, Aug 24, 2006 at 11:43:01PM -0400, Daniel Jacobowitz wrote:
> On Fri, Aug 25, 2006 at 04:13:11AM +0200, Jan Kratochvil wrote:
> > * with -ggdb2 and less "errno" in fact does not exist anywhere as it was
> >   compiled to "(*__errno_location ())" and the macro definition is not present.
> >   Unfortunately gdb will find the TLS symbol and it will try to access it but
> >   as the program has been compiled without -lpthread the TLS base register
> >   (%gs on i386) is not setup and it will result in:
> >   	Cannot access memory at address 0x8
> 
> That can't be correct.  Every program using glibc references errno.
> If the program can access it, then GDB ought to be able to also.
> In this case, libc.so.6 exports a dynamic TLS symbol named errno.
> 
> Did you try this with the patch you posted earlier to access TLS
> without debug info?

Oh, I see now - that's not enough, you'd also need to implement direct
DTV lookup in GDB since libthread_db probably can't cope.  And that
might require some fiddling with e.g. the remote protocol, too, to get
at the result of ps_get_thread_area.  Anyway, this is doable, just
a bit of work.

With your other patch, I hope this would get a more appropriate error,
like "can't access thread local data"?

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2006-08-25 13:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-25 13:43 Jan Kratochvil
2006-08-25 16:43 ` Daniel Jacobowitz
2006-08-26 11:56   ` Daniel Jacobowitz [this message]
2006-08-25 13:48     ` RFC: Access TLS symbols without DWARF debuginfo Jan Kratochvil
2006-08-25 20:02       ` Daniel Jacobowitz
2006-08-28 18:27         ` RFC: Access TLS symbols without DWARF debuginfo v2 Jan Kratochvil
2006-08-28 21:02           ` Jim Blandy
2006-08-29 11:41             ` Daniel Jacobowitz
2006-10-09 20:20               ` Daniel Jacobowitz
2006-10-10  3:22         ` RFC: Access TLS symbols without DWARF debuginfo Daniel Jacobowitz
2006-10-10  4:25           ` Eli Zaretskii
2006-10-17 21:03             ` Daniel Jacobowitz
2006-10-17 22:03               ` Jan Kratochvil
2006-10-18 15:29                 ` Daniel Jacobowitz
2006-10-18  4:27               ` Eli Zaretskii

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=20060825134750.GA5857@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@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