Bug 336619 - valgrind --read-var-info=yes doesn't handle DW_TAG_restrict_type
Summary: valgrind --read-var-info=yes doesn't handle DW_TAG_restrict_type
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: Mark Wielaard
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-23 14:51 UTC by Mark Wielaard
Modified: 2014-07-15 15:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Recognize DW_TAG_restrict_type qualifier (1.95 KB, patch)
2014-06-23 14:54 UTC, Mark Wielaard
Details
valgrind --read-var-info=yes doesn't handle DW_TAG_restrict_type. (5.91 KB, patch)
2014-06-23 22:01 UTC, Mark Wielaard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2014-06-23 14:51:36 UTC
Currently GCC doesn't output the C99 type qualifier restrict (DW_TAG_restrict_type)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59051
But when that bug is fixed then valgrind will produce errors when run with --read-var-info=yes

$ valgrind -q --read-var-info=yes ./restrict.exe 
chase_cuOff: no entry for 0x00165
chase_cuOff: no entry for 0x00199
chase_cuOff: no entry for 0x00165

: Invalid cuOff = 0x0008d
--14375-- WARNING: Serious error when reading debug info
--14375-- When reading debug info from /home/mark/build/gcc-obj/restrict.exe:
--14375-- resolve_variable_types: cuOff does not refer to a known type

The DIEs at the cuOffs complained about are all DW_TAG_restrict_type.

Reproducible: Always
Comment 1 Mark Wielaard 2014-06-23 14:54:58 UTC
Created attachment 87341 [details]
Recognize DW_TAG_restrict_type qualifier

Testing the following patch.
Comment 2 Mark Wielaard 2014-06-23 22:01:37 UTC
Created attachment 87351 [details]
valgrind --read-var-info=yes doesn't handle DW_TAG_restrict_type.

Full patch including a testcase to make sure that when a fixed GCC generates a DW_AT_restrict_type then valgrind works just fine even when using --read-var-info=yes.
Comment 3 Mark Wielaard 2014-07-15 15:48:07 UTC
Pushed as valgrind r14165.
With the testcase extended so it prints the name of the restricted pointer argument.