This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: multi-thread debugging not working


"Lucy Zhang" <lucyz@uclink4.berkeley.edu> writes:
> Yes, the newer version of GDB solved the previous problem.
> 
> Now I have a new problem with not being able to debug my multi-threaded
> program. I'm debugging using an ELF core dump that was coverted from another
> format. The program i'm debugging has about 20 threads. It may be because
> the ELF file i'm creating is missing certain information. Right now I'm at a
> loss as to what could be missing which GDB might be looking for in order to
> see the multiple threads. Does anyone have any ideas on how GDB recognize
> threads from an ELF core dump?

Try running the command `readelf -n' on your core dump.  In a
multi-threaded core dump, you should see something like this:

$ readelf -n core.9940

Notes at offset 0x00000254 with length 0x00000d4c:
 Owner         Data size       Description
 CORE          0x0000007c      NT_PRPSINFO (prpsinfo structure)
 CORE          0x00000090      NT_PRSTATUS (prstatus structure)
 CORE          0x0000006c      NT_FPREGSET (floating point registers)
 LINUX         0x00000200      NT_PRXFPREG (user_xfpregs structure)
 CORE          0x00000090      NT_PRSTATUS (prstatus structure)
 CORE          0x0000006c      NT_FPREGSET (floating point registers)
 LINUX         0x00000200      NT_PRXFPREG (user_xfpregs structure)
 CORE          0x00000090      NT_PRSTATUS (prstatus structure)
 CORE          0x0000006c      NT_FPREGSET (floating point registers)
 LINUX         0x00000200      NT_PRXFPREG (user_xfpregs structure)
 CORE          0x00000090      NT_PRSTATUS (prstatus structure)
 CORE          0x0000006c      NT_FPREGSET (floating point registers)
 LINUX         0x00000200      NT_PRXFPREG (user_xfpregs structure)

This program had four threads in it; note that there's one prstatus
structure, one user_xfpregs structure, and one floating point register
structure for each thread.

If you only see one of each kind of register note, then there's only
one thread in the core file.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]