diff options
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 19 |
2 files changed, 24 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6c23281..3aaeb92 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2019-05-15 Sergio Durigan Junior <sergiodj@redhat.com> + + Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1708192 + * dwarf2read.c (parse_macro_definition): Check whether 'body' is + NULL, and complain/return if that's the case. + 2019-05-15 John Darrington <john@darrington.wattle.id.au> * s12z-tdep.c (push_pull_get_stack_adjustment): New function. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index b29c089..0e3f37f 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -24609,7 +24609,24 @@ dwarf_decode_macro_bytes (struct dwarf2_cu *cu, line == 0 ? _("zero") : _("non-zero"), line, body); if (is_define) - parse_macro_definition (current_file, line, body); + { + if (body != NULL) + parse_macro_definition (current_file, line, body); + else + { + /* Fedora's rpm-build's "debugedit" binary + corrupted .debug_macro sections. + + For more info, see + https://bugzilla.redhat.com/show_bug.cgi?id=1708786 */ + complaint (_("debug info gives %s invalid macro definition " + "without body (corrupted?) at line %d" + "on file %s"), + at_commandline ? _("command-line") + : _("in-file"), + line, current_file->filename); + } + } else { gdb_assert (macinfo_type == DW_MACRO_undef |