aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorJonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>2016-01-06 10:10:39 +0400
committerJoel Brobecker <brobecker@adacore.com>2016-01-17 10:11:02 +0400
commitdc365182240722969f044918ecd3cab00da55502 (patch)
treecbe0e5c2b7be34375cb74e18cbd1a25fbcc6d776 /gdb/dwarf2read.c
parentb677098d4e086c093554a064076e021fec0399e8 (diff)
downloadfsf-binutils-gdb-dc365182240722969f044918ecd3cab00da55502.zip
fsf-binutils-gdb-dc365182240722969f044918ecd3cab00da55502.tar.gz
fsf-binutils-gdb-dc365182240722969f044918ecd3cab00da55502.tar.bz2
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.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index c410500..1020c12 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: