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>
Cc: gdb-patches@sourceware.org
Subject: Re: RFC: Access TLS symbols without DWARF debuginfo
Date: Fri, 25 Aug 2006 20:02:00 -0000	[thread overview]
Message-ID: <20060825134315.GA4994@nevyn.them.org> (raw)
In-Reply-To: <20060825021304.GA30225@host0.dyn.jankratochvil.net>

On Fri, Aug 25, 2006 at 04:13:04AM +0200, Jan Kratochvil wrote:
> Hi,
> 
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337
> 
> currently if you have threaded (-lpthread) program compiled without debuginfo
> "-g" and you try to access TLS symbol you will get:
> 	(gdb) print thread_local
> 	Cannot access memory at address 0x0
> 
> as gdb tries to resolve TLS-offset as absolute memory reference.
> 
> In fact it occurs if you try to access "errno" on -lpthread program with
> debuginfo lower than -ggdb3.
> 
> Attached patch implements accessing them without the debuginfo suggestions as
> not always such associatet debuginfo is available.  It checks for
> 	SYMBOL_BFD_SECTION (msymbol)->flags & SEC_THREAD_LOCAL
> symbols, implements for them new `UNOP_MEMVAL_TLS' and reuses for them former
> `dwarf_expr_tls_address'.

Thanks for doing this.  It's a good idea, and the first step to not
needing libthread_db to do this - in most cases the gdbarch vector
should have enough knowledge.  And overall the patch looks very nice.

The same general comments apply as to your other patch, e.g. about a
ChangeLog.

Could you explain why you added a new kind of value for this?  I'd have
thought that when we wanted the address of the symbol, we should be
able to resolve it.  So instead of value_at_lazy_tls, we would resolve
the address using the target.  Expressions persist between threads and
executions, but values shouldn't.  That should simplify the code a
little.


-- 
Daniel Jacobowitz
CodeSourcery


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

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-25 13:43 RFC: Ignore TLS symbols for non-TLS programs Jan Kratochvil
2006-08-25 16:43 ` Daniel Jacobowitz
2006-08-26 11:56   ` Daniel Jacobowitz
2006-08-25 13:48     ` RFC: Access TLS symbols without DWARF debuginfo Jan Kratochvil
2006-08-25 20:02       ` Daniel Jacobowitz [this message]
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=20060825134315.GA4994@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