mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Yehuda Yitchak <yehuda80@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: Rich Felker <dalias@libc.org>, musl@lists.openwall.com
Subject: Re: [musl] Accessing Thread-Local-Storage in GDB
Date: Thu, 10 Feb 2022 20:05:15 +0200	[thread overview]
Message-ID: <CAN2=dsz8tob_c+nJBJnzC_dvF8J1nre5cbmL+nYERRbs9taxRg@mail.gmail.com> (raw)
In-Reply-To: <87a6ezx8wc.fsf@oldenburg.str.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1195 bytes --]

I forgot to mention I work on arm64
I guess there isn't much I can do at the moment, right ?

On Thu, Feb 10, 2022, 13:23 Florian Weimer <fweimer@redhat.com> wrote:

> * Rich Felker:
>
> > Indeed, I was just offering a quick workaround that might help, not
> > suggesting gdb should do that. __tls_get_addr can be used for
> > non-dynamic symbols with information already available to the
> > debugger. For core files you could probably simulate execution and
> > abort if anything is reached that would need to change process state
> > (lazy allocation) although that doesn't happen with musl anyway. But I
> > wonder if the core file even records the x86 segment information
> > needed to preserve thread pointer and simulate the %fs/%gs based
> > loads on x86[_64]..?
>
> The register is available as $fs_base on x86-64:
>
> (gdb) print (void *)$fs_base
> $1 = (void *) 0x7f2d12981740
> (gdb) print *(void **)$fs_base
> $2 = (void *) 0x7f2d12981740
>
> It probably does not work on i386 (even as $gs_base).  I do not think it
> depends on FSGSBASE support in the kernel, but maybe I'm mistaken.  I
> think I looked at this three years ago and couldn't make it work.
>
> Thanks,
> Florian
>
>

[-- Attachment #2: Type: text/html, Size: 1603 bytes --]

  reply	other threads:[~2022-02-10 21:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09  7:32 Yehuda Yitchak
2022-02-09 18:33 ` Rich Felker
2022-02-09 20:44   ` Florian Weimer
2022-02-09 22:31     ` Rich Felker
2022-02-10 11:23       ` Florian Weimer
2022-02-10 18:05         ` Yehuda Yitchak [this message]
2022-02-10 21:32           ` Rich Felker

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='CAN2=dsz8tob_c+nJBJnzC_dvF8J1nre5cbmL+nYERRbs9taxRg@mail.gmail.com' \
    --to=yehuda80@gmail.com \
    --cc=dalias@libc.org \
    --cc=fweimer@redhat.com \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).