Bug 298864 - DWARF reader mis-parses DW_FORM_ref_addr
Summary: DWARF reader mis-parses DW_FORM_ref_addr
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-26 17:20 UTC by Tom Tromey
Modified: 2012-04-29 11:35 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
proposed patch (1.09 KB, patch)
2012-04-26 17:21 UTC, Tom Tromey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2012-04-26 17:20:50 UTC
I'm using the 'dwz' tool to compress DWARF debuginfo:
http://gcc.gnu.org/ml/gcc/2012-04/msg00686.html

This generates partial units and refrs to them using DW_TAG_imported_unit.
It generates a DW_FORM_ref_addr.

Right now valgrind does:

-         *cts = (ULong)(UWord)get_UWord(c);
-         *ctsSzB = sizeof(UWord);

But, the DWARF standard (version 3) says:

In the 32-bit DWARF format, this offset is a 4-byte unsigned value; in the 64-bit DWARF format, it is an 8-byte unsigned value

So, I think this should use get_Dwarfish_Word instead.

Patch to follow.

Reproducible: Always
Comment 1 Tom Tromey 2012-04-26 17:21:43 UTC
Created attachment 70672 [details]
proposed patch

This patch changes DW_FORM_ref_addr to use the proper size.
Comment 2 Julian Seward 2012-04-29 11:35:55 UTC
Committed, r12545.  Thanks!