Re: [patch] build-id .debug files load (like .gnu_debuglink)

Daniel Jacobowitz
2007-08-25T23:58:14Z

On Sun, Aug 26, 2007 at 12:49:14AM +0200, Jan Kratochvil wrote:
> You are right about the content of `/lib64/ld-linux-x86-64.so.2'.
> Still in such case both `.dynsym' and `.symtab' gets read into MSYMBOLS but
> PSYMTABS and SYMTABS are left forever NULL for the main executable (as there is
> no .debug_info).
>
> While I would still expect the former patch was right I changed it according to
> your advice. It is definitely the safe way but with a tiny performance hit:
>
> The reason of my check was that build-id (contrary to the debug-link) is always
> present there, even for locally built unsplit files. With the patch attached
> below GDB will try to open a separate debug file in /usr/lib/debug/.debug-id/
> even for the unsplit files. This step did not happen with my former patch.

Right. There's two other ways we could check, which Roland suggested:
presence of .gnu_debuglink and presence of .debug_info.

I misread your original patch. If there's no .debug_info then there
won't be any psymtabs. So that's probably the best check, and I
apologize for the bad advice. I don't want to check for
.gnu_debuglink; in the future maybe files which use build ID won't
have a .gnu_debuglink section any more.

--
Daniel Jacobowitz
CodeSourcery