public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Wrong filename assigned to function while reading DWARF debug info
@ 2022-08-22  6:28 Robert Graulich
  0 siblings, 0 replies; only message in thread
From: Robert Graulich @ 2022-08-22  6:28 UTC (permalink / raw)
  To: gdb; +Cc: Robert Graulich

Hi,

This is about GDB 12.1 on Linux. Object files are compiled by armclang.

We run into the situation, where some functions of a stack trace do not have source code filenames associated with the function names. GDB even claims that there is no debug info available for these functions, while all source files are compiled with debug info. But readelf and objdump show the correct source code filenames for these functions.

Debugging into this (elf_symtab_read() in elfread.c) shows that the correct filename is stored in filesymname at line 353. But this filename gets overwritten by another filename a bit later for a few functions, which belong to a runtime library. This file is not available in the file system. A few functions later, we arrive at one of the functions in the stack trace. Now the function gets the wrong filename assigned.

This looks like the variable filesymname should store the filenames in a stack. Then we could have nested scopes of source filenames. But then the question is, how to identify the end of such a source file scope while reading the debug info.

Did somebody else encounter this issue? Any ideas, what else could cause this issue?
Regards,
Robert


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-22  6:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22  6:28 Wrong filename assigned to function while reading DWARF debug info Robert Graulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).