]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gprofng not reading references correctly in Dwarf
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Mon, 28 Apr 2025 03:28:30 +0000 (20:28 -0700)
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Tue, 29 Apr 2025 06:43:20 +0000 (23:43 -0700)
commitb1f0f5b31c414b3445cdcbc5bf9ca31638c7712a
tree9937a88ac244d4f1d10c57d448a4678fc42f8437
parent82bdc396a40e64ea17acdba072bafbb3f620518f
gprofng not reading references correctly in Dwarf

Fixed as specified in the DWARF standard:
 The first type of reference can identify any debugging information entry
 within the containing unit. This type of reference is an offset from the first
 byte of the compilation header for the compilation unit containing
 the reference. There are five forms for this type of reference.
 There are fixed length forms for one, two, four and eight byte offsets
 (respectively, DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, and DW_FORM_ref8).
 There is also an unsigned variable length offset encoded form that uses
 unsigned LEB128 numbers (DW_FORM_ref_udata).

gprofng/ChangeLog
2025-04-27  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

* src/DwarfLib.cc (set_die): Handling DWARF references (DW_FORM_ref1,
DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata).
* src/Dwarf.cc: Likewise.
gprofng/src/Dwarf.cc
gprofng/src/DwarfLib.cc