From: Jonas Hahnfeld Date: Wed, 6 Jan 2016 06:10:39 +0000 (+0400) Subject: GDB SIGSEGV opening a Fortran program compiled with ifort X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dc365182240722969f044918ecd3cab00da55502;p=binutils-gdb.git GDB SIGSEGV opening a Fortran program compiled with ifort 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fe8fd6c3481..dbc4b081e7b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2016-01-17 Jonas Hahnfeld (tiny change) + + Pushed by Joel Brobecker . + 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 * charset.c [PHONY_ICONV] (GDB_DEFAULT_HOST_CHARSET): diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index c4105007843..1020c12690b 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -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: