From: Steve Ellcey <sellcey@cavium.com>
To: Pedro Alves <palves@redhat.com>, gdb@sourceware.org
Subject: Re: gdb / thread_db / multiple ABI question
Date: Mon, 10 Jul 2017 19:45:00 -0000 [thread overview]
Message-ID: <1499715948.13519.49.camel@cavium.com> (raw)
In-Reply-To: <a05b8a10-b93e-80a6-a4e1-60f72a0afcd0@redhat.com>
I never noticed that the 3 TIDs were all the same. Â I am looking
at elf.c:elfcore_grok_note and I noticed something odd that doesn't
seem related to the ILP32 work.  If I look at the note->type
values that come in and get used in the switch statement, I see 0x401,
0x402, 0x403, and 0x404. Â But 0x404 is not defined
in include/elf/common.h.  There is a 0x405, but no 0x404.  Any
idea why?
Steve Ellcey
sellcey@cavium.com
On Mon, 2017-07-10 at 19:21 +0100, Pedro Alves wrote:
> On 07/10/2017 07:02 PM, Steve Ellcey wrote:
> >
> > No, without thread_db I get this:
> >
> > (gdb) file m32
> > Reading symbols from m32...done.
> > (gdb) core c_32
> > [New LWP 79425]
> > [New LWP 79425]
> > [New LWP 79425]
> This means that GDB/bfd thinks that there are 3 threads
> in the core, but they all have the same TID, which is of course
> bogus.  So this still looks to me like something is wrong on
> the bfd side.  Try "objdump -h c_32".  You should see
> one ".reg/NNN" section per thread, like e.g.:
>
> Â $ objdump -h core.1904 | grep "reg/"
> Â Â Â 1
> .reg/1904Â Â Â Â Â 000000d8Â Â 0000000000000000Â Â 0000000000000000Â Â 000006a0Â
> Â 2**2
> Â Â Â 9
> .reg/1909Â Â Â Â Â 000000d8Â Â 0000000000000000Â Â 0000000000000000Â Â 00000e00Â
> Â 2**2
> Â 13
> .reg/1910Â Â Â Â Â 000000d8Â Â 0000000000000000Â Â 0000000000000000Â Â 00001560Â
> Â 2**2
>
> Put a breakpoint on elf.c:elfcore_grok_note, and step through it,
> checking that the proper NT_PRSTATUS / NT_PSINFO hooks get called
> via the elf_backend_data vector, and check that they're extracting
> the right fields/offsets out of the core structures.
>
> Once you get 3 threads without libthread_db., then this:
>
> >
> > (gdb) info threads
> Found 0 new threads in iteration 0.
> >
> >  Id   Target Id         FrameÂ
> > * 3Â Â Â Â Thread 0xf739ef70 (LWP 8660) 0x00400680 in doSomeThing ()
> > Â 4Â Â Â Â Thread 0xf69bf490 (LWP 8662) warning: Couldn't find general-
> > purpose registers in core file.
> > PC register is not available
> should not longer happen.  The above with libthread_db is very likely
> happening because libthread_db found a thread that maps to LWP 8662
> in libpthread's internal data structures, but then GDB/bfd can't
> find the ".reg/8662" note/section in the core dump.
>
> Thanks,
> Pedro Alves
next prev parent reply other threads:[~2017-07-10 19:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-07 18:20 Steve Ellcey
2017-07-07 18:36 ` Pedro Alves
2017-07-07 20:30 ` Steve Ellcey
2017-07-10 7:39 ` Yao Qi
2017-07-10 16:58 ` Steve Ellcey
2017-07-10 8:29 ` Andreas Schwab
2017-07-10 9:43 ` Pedro Alves
2017-07-10 18:02 ` Steve Ellcey
2017-07-10 18:21 ` Pedro Alves
2017-07-10 19:45 ` Steve Ellcey [this message]
2017-07-11 8:38 ` Yao Qi
2017-07-10 21:22 ` Steve Ellcey
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=1499715948.13519.49.camel@cavium.com \
--to=sellcey@cavium.com \
--cc=gdb@sourceware.org \
--cc=palves@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