From: Robert Graulich <Robert.Graulich@synopsys.com>
To: "firstname.lastname@example.org" <email@example.com>
Cc: Robert Graulich <Robert.Graulich@synopsys.com>
Subject: Wrong filename assigned to function while reading DWARF debug info
Date: Mon, 22 Aug 2022 06:28:09 +0000 [thread overview]
Message-ID: <CH2PR12MB497189FFD080139975913728B8719@CH2PR12MB4971.namprd12.prod.outlook.com> (raw)
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?
reply other threads:[~2022-08-22 6:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).