Re: gdb / thread_db / multiple ABI question

Steve Ellcey
2017-07-07T20:30:44Z

On Fri, 2017-07-07 at 19:36 +0100, Pedro Alves wrote:
>
> Though I have no idea whether an Aarch64 build of libthread_db is
> capable of biarch debugging.Â Â It may be that GDB is already trying to
> the load the 64-bit libthread_db, but then libthread_db rejects
> the inferior for some reason.Â Â The "set debug libthread-db" option
> should
> help you figure that out.Â Â See below.

OK, settingÂ libthread-db-search-path andÂ debug libthread-db got me
a bit further. Â I don't get any errors or warnings about not being
able to find or load libthread_db. Â It's still not reading everything
correctly though:

(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

I don't see any code in gdb/linux-thread-db.c that seems to be
conditional on the word size (ILP32 vs LP64). Â I also don't see
anything in glibc nptl-db directory that appears to be conditional on
word size. Â Things like pthread_t andÂ __SIZEOF_PTHREAD_ATTR_T areÂ
different for the two different ABIs though. Â But that is true for x86
too and things seem to be working there. Â I am not sure what (if
anything) would need to be done to libthread_db to support biarch
debugging.

Steve Ellcey
sellcey@cavium.com