GDB SIGSEGV opening a Fortran program compiled with ifort
authorJonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>
Wed, 6 Jan 2016 06:10:39 +0000 (10:10 +0400)
committerJoel Brobecker <brobecker@adacore.com>
Sun, 17 Jan 2016 06:11:02 +0000 (10:11 +0400)
This patch fixes a SIGSEGV when trying to open a Fortran program
compiled with ifort (reproduced using version using version 16.0.1.150).
The error can be reproduce with most, if not any program. For instance,
a single file only containing "end", compiled with no additional flag,
suffices.

gdb/ChangeLog:

       PR gdb/19208
       * dwarf2read.c (read_partial_die): Do not call set_objfile_main_name
       if the function has no name.

gdb/ChangeLog
gdb/dwarf2read.c

index fe8fd6c348196996d903948565e1e21c8d0f2838..dbc4b081e7b84223fe722d6b4993ded59aed721a 100644 (file)
@@ -1,3 +1,10 @@
+2016-01-17  Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>  (tiny change)
+
+       Pushed by Joel Brobecker  <brobecker@adacore.com>.
+       PR gdb/19208
+       * dwarf2read.c (read_partial_die): Do not call set_objfile_main_name
+       if the function has no name.
+
 2016-01-15  Sandra Loosemore  <sandra@codesourcery.com>
 
        * charset.c [PHONY_ICONV] (GDB_DEFAULT_HOST_CHARSET):
index c4105007843d9fceb59f3880b437856d547e2b8b..1020c12690bfc0aedfdb916e62c88c755e84af37 100644 (file)
@@ -15936,7 +15936,8 @@ read_partial_die (const struct die_reader_specs *reader,
             compilers pick up the new representation, we'll support this
             practice.  */
          if (DW_UNSND (&attr) == DW_CC_program
-             && cu->language == language_fortran)
+             && cu->language == language_fortran
+             && part_die->name != NULL)
            set_objfile_main_name (objfile, part_die->name, language_fortran);
          break;
        case DW_AT_inline: