This is a C++ application developed at the University of Bristol. The developers run into the problem that "gprofng display text" cannot locate the source file(s), while the application and library objects have been compiled with -g. This problem seems to be related to interpreting the DWARF output. If -gdwarf-2 is added on the g++ compile lines, the source files can be located and source line level information is printed. If however, -gdwarf-3 is used, the locations of the source files cannot be found and consequently, no source line level information is printed. A test case exhibiting this problem has been made available. The program needs to be compiled with g++ 8.5 and that has been used in the tests.
The master branch has been updated by Vladimir Mezentsev <vmezents@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0b3ad397ef2dc54602d7966af53515061312733c commit 0b3ad397ef2dc54602d7966af53515061312733c Author: Vladimir Mezentsev <vladimir.mezentsev@oracle.com> Date: Mon Dec 18 21:04:57 2023 -0800 gprofng: 31169 Source code locations can not be found in a C++ application gprofng incorrectly reads the form of the DW_FORM_ref_addr attribute for DWARF Version 3 or later. From DWARF specification: References that use the attribute form DW_FORM_ref_addr are specified to be four bytes in the DWARF 32-bit format and eight bytes in the DWARF 64-bit format, while DWARF Version 2 specifies that such references have the same size as an address on the target system. 2023-12-18 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/31169 * src/DwarfLib.cc: Fix the reader for DW_FORM_ref_addr.
Update status as resolved/fixed.