[PATCH 01/13] gdb/dwarf: change read_loclist_index complaints into errors

Zoran Zaric Zoran.Zaric@amd.com
Thu Jan 28 15:17:25 GMT 2021


> From: Simon Marchi <simon.marchi@efficios.com>
> 
> Unlike read_rnglists_index, read_loclist_index uses complaints when it
> detects an inconsistency (a DW_FORM_loclistx value without a
> .debug_loclists section or an offset outside of the section).  I really
> think they should be errors, since there's no point in continuing if
> this situation happens, we will likely segfault or read garbage.
> 

Makes sense.

Although unless I misunderstand something, isn't the difference here 
that the error will actually throw an exception and therefore stop 
reading of the compilation unit if not the whole object file debug 
information?

If this is the case, then considering the difference in usage between 
the two, having a wrong loclist information can still provide a correct 
line table information, but having a wrong rnglist information in my 
mind creates a more serious issue.

On the other hand, how much can one trust in the information correctness 
if either of those are wrong.


More information about the Gdb-patches mailing list