This is the mail archive of the gdb-patches@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: thread ptids when debugging from core file (x86-linux)


Joel, this observation of yours is the key:


>Unfortunately, that doesn't work when debugging from a core file,
>because the PTID of the threads are not the same as when debugging
>live.


The best way to appreciate this is to consider:


(gdb) attach program
(gdb) info threads
thread output #1
(gdb) info lwp -- yes ok, that cmd doesn't exist :-)
lwp output #1 (different to the thread output)
(gdb) gcore program.gcore
(gdb) detach
Segmentation fault core dumped to program.core
(gdb) corefile program.core
(gdb) info threads
identical thread output #2
(gdb) info lwp
identical lwp output #2
(gdb) corefile program.gcore
(gdb) info threads
also identical output #3
(gdb) info lwp
also identical lwp output #3


I am sorry, I don't understand what you are saying. What do you
mean by "identical output #n"? What is it identical to? to output
#1? (right now, it is not).

Yes. ``thread output'' #1, #2, an #3 should be identical. Similarly ``lwp output'' 1-3 should also be identical.


The're not, its a bug (and one everyone has been trying to sweep under the carpet). The corefile code should be loading libthread_db so that GDB can use the .reg/<LWPID> along with memory information to re-create the thread list. At one stage it even did that but it was then disabled because it caused a core dump and ...

Andrew



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