aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2010-09-08 23:34:11 +0000
committerDaniel Jacobowitz <drow@false.org>2010-09-08 23:34:11 +0000
commit60430eff89ca096d1e5fc83654a29a588426016d (patch)
tree794f8236f8dca64e9ea877bdfd85e30592a88487 /gdb/dwarf2read.c
parentf1078f667a229ab206bcff9a33ab46f56277bf7f (diff)
downloadgdb-60430eff89ca096d1e5fc83654a29a588426016d.zip
gdb-60430eff89ca096d1e5fc83654a29a588426016d.tar.gz
gdb-60430eff89ca096d1e5fc83654a29a588426016d.tar.bz2
* dwarf2read.c (dwarf2_compute_name): Check that the first
argument is a pointer.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index cfe42d6..f727c9d 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);
}