]> Git Repo - binutils.git/blobdiff - gdb/dwarf2read.c
Don't crash if dwarf_decode_macro_bytes's 'body' is NULL
[binutils.git] / gdb / dwarf2read.c
index b29c089606db9c5a710aa6203d278374461e451a..0e3f37ff742d91d6ab08ba6c90485cec783fc1ca 100644 (file)
@@ -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
This page took 0.048526 seconds and 4 git commands to generate.