From: Daniel Jacobowitz Date: Wed, 8 Sep 2010 23:34:11 +0000 (+0000) Subject: * dwarf2read.c (dwarf2_compute_name): Check that the first X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=60430eff89ca096d1e5fc83654a29a588426016d;p=binutils-gdb.git * dwarf2read.c (dwarf2_compute_name): Check that the first argument is a pointer. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 63814faa07f..ece5ab70dc8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-09-08 Daniel Jacobowitz + + * dwarf2read.c (dwarf2_compute_name): Check that the first + argument is a pointer. + 2010-09-08 Daniel Jacobowitz * dwarf2read.c (read_func_scope, read_structure_type) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index cfe42d62333..f727c9dd3f6 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -4848,8 +4848,14 @@ dwarf2_compute_name (char *name, struct die_info *die, struct dwarf2_cu *cu, } else if (cu->language == language_cplus) { + /* Assume that an artificial first parameter is + "this", but do not crash if it is not. RealView + marks unnamed (and thus unused) parameters as + artificial; there is no way to differentiate + the two cases. */ if (TYPE_NFIELDS (type) > 0 && TYPE_FIELD_ARTIFICIAL (type, 0) + && TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) == TYPE_CODE_PTR && TYPE_CONST (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0)))) fputs_unfiltered (" const", buf); }