Re: [PATCH 17/20] Change die_info methods to check the attribute's form

Tom Tromey
2020-03-30T19:04:14Z

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

>> + if ((attrs[i].name == DW_AT_addr_base
>> + || attrs[i].name == DW_AT_GNU_addr_base)
>> + && attrs[i].form_is_unsigned ())
>> {
>> /* If both exist, just use the first one. */
>> - return DW_UNSND (&attrs[i]);
>> + return attrs[i].get_unsigned ();
>> }
>> return gdb::optional<ULONGEST> ();
>> }

Simon> A bit like in the previous patch, if there is a DW_AT_addr_base, but it's
Simon> not of the right form, I think we should emit a warning saying that we ignore
Simon> it, instead of just ignoring it silently.

I tend to think gdb complaints are just time-wasters TBH.

Normally no one examines them. They aren't visible to users, and if
they were they wouldn't make sense or be actionable anyway.

I enable complaints in my gdbinit but they've turned out just to be
noise. In fact, last time I fixed a bug that was noted by a complaint,
it turned out I didn't realize that gdb was complaining until well after
the fact.

I'm all for checking the DWARF output of compilers, but I think it's
better as a separate tool; and should be done in a context where someone
actually wants to fix the compiler bugs.

I guess that's why I left out complaints in some spots.

Tom