mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 04:00:07 +08:00
gdb/dwarf: change read_loclist_index complaints into errors
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. gdb/ChangeLog: * dwarf2/read.c (read_loclist_index): Change complaints into errors. Change-Id: Ic3a1cf6e682d47cb6e739dd76fd7ca5be2637e10
This commit is contained in:

committed by
Simon Marchi

parent
5424d7ed94
commit
a0c1eeba9b
@ -1,3 +1,8 @@
|
|||||||
|
2021-02-02 Simon Marchi <simon.marchi@efficios.com>
|
||||||
|
|
||||||
|
* dwarf2/read.c (read_loclist_index): Change complaints into
|
||||||
|
errors.
|
||||||
|
|
||||||
2021-02-02 Tom de Vries <tdevries@suse.de>
|
2021-02-02 Tom de Vries <tdevries@suse.de>
|
||||||
|
|
||||||
PR symtab/24620
|
PR symtab/24620
|
||||||
|
@ -20218,19 +20218,22 @@ read_loclist_index (struct dwarf2_cu *cu, ULONGEST loclist_index)
|
|||||||
|
|
||||||
section->read (objfile);
|
section->read (objfile);
|
||||||
if (section->buffer == NULL)
|
if (section->buffer == NULL)
|
||||||
complaint (_("DW_FORM_loclistx used without .debug_loclists "
|
error (_("DW_FORM_loclistx used without .debug_loclists "
|
||||||
"section [in module %s]"), objfile_name (objfile));
|
"section [in module %s]"), objfile_name (objfile));
|
||||||
|
|
||||||
struct loclists_rnglists_header header;
|
struct loclists_rnglists_header header;
|
||||||
read_loclists_rnglists_header (&header, section);
|
read_loclists_rnglists_header (&header, section);
|
||||||
if (loclist_index >= header.offset_entry_count)
|
if (loclist_index >= header.offset_entry_count)
|
||||||
complaint (_("DW_FORM_loclistx pointing outside of "
|
error (_("DW_FORM_loclistx pointing outside of "
|
||||||
".debug_loclists offset array [in module %s]"),
|
".debug_loclists offset array [in module %s]"),
|
||||||
objfile_name (objfile));
|
objfile_name (objfile));
|
||||||
|
|
||||||
if (loclist_base + loclist_index * cu->header.offset_size
|
if (loclist_base + loclist_index * cu->header.offset_size
|
||||||
>= section->size)
|
>= section->size)
|
||||||
complaint (_("DW_FORM_loclistx pointing outside of "
|
error (_("DW_FORM_loclistx pointing outside of "
|
||||||
".debug_loclists section [in module %s]"),
|
".debug_loclists section [in module %s]"),
|
||||||
objfile_name (objfile));
|
objfile_name (objfile));
|
||||||
|
|
||||||
const gdb_byte *info_ptr
|
const gdb_byte *info_ptr
|
||||||
= section->buffer + loclist_base + loclist_index * cu->header.offset_size;
|
= section->buffer + loclist_base + loclist_index * cu->header.offset_size;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user