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
Created attachment 87341 [details] Recognize DW_TAG_restrict_type qualifier Testing the following patch.
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.
Pushed as valgrind r14165. With the testcase extended so it prints the name of the restricted pointer argument.