Re: question about why gdb needs executable's binary
Jan Kratochvil <[email protected]> Tue, 19 Mar 2019 16:41:44 +0100
| Newsgroups | gmane.comp.gdb.devel,gmane.comp.gdb.general |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 19 Mar 2019 16:25:30 +0100, Jirka Koutn=C3=BD wrote: > I see, just to make sure - DT_DEBUG gets dumped into the corefile, is that > correct? The PT_DYNAMIC segment containing the DT_DEBUG pointer (pointing to r_debug/_r_debug) normally gets dumped into the core file. The problem is t= hat without having the main executable one cannot much find where is the DT_DEB= UG pointer located in the core file. Core file has for example NT_AUXV where is AT_PHDR and from program headers one could find PT_DYNAMIC where is DT_DEBU= G. But core file does not have to contain the program headers as those may be = in a read-only page of the main executable. Nowadays with dumping of the first page of any ELF (even if it is read-only, for its NT_GNU_BUILD_ID) one can probably find the program headers there. But then one can also just read NT_FILE nowadays. Jan