From d76b7dbc5f5faacd9804b8aa387858a41eb20488 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 13 Jul 2012 20:15:03 +0000 Subject: [PATCH] gdb/ * dwarf2read.c (read_call_site_scope): Do not gdb_assert for invalid read-in CALL_SITE_PARAMETER_PARAM_OFFSET. --- gdb/ChangeLog | 5 +++++ gdb/dwarf2read.c | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 092bab2151e..48ace52e766 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-07-13 Jan Kratochvil + + * dwarf2read.c (read_call_site_scope): Do not gdb_assert for invalid + read-in CALL_SITE_PARAMETER_PARAM_OFFSET. + 2012-07-13 Doug Evans * symtab.c (output_source_filename): Delete unnecessary forward decl. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index abb630cfefc..9e3be9f4c61 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8878,7 +8878,18 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu) parameter->kind = CALL_SITE_PARAMETER_PARAM_OFFSET; offset = dwarf2_get_ref_die_offset (origin); - gdb_assert (offset.sect_off >= cu->header.offset.sect_off); + if (!offset_in_cu_p (&cu->header, offset)) + { + /* As DW_OP_GNU_parameter_ref uses CU-relative offset this + binding can be done only inside one CU. Such referenced DIE + therefore cannot be even moved to DW_TAG_partial_unit. */ + complaint (&symfile_complaints, + _("DW_AT_abstract_origin offset is not in CU for " + "DW_TAG_GNU_call_site child DIE 0x%x " + "[in module %s]"), + child_die->offset.sect_off, objfile->name); + continue; + } parameter->u.param_offset.cu_off = (offset.sect_off - cu->header.offset.sect_off); } -- 2.30.2