diff options
author | Daniel Jacobowitz <drow@false.org> | 2010-09-08 23:34:11 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2010-09-08 23:34:11 +0000 |
commit | 60430eff89ca096d1e5fc83654a29a588426016d (patch) | |
tree | 794f8236f8dca64e9ea877bdfd85e30592a88487 | |
parent | f1078f667a229ab206bcff9a33ab46f56277bf7f (diff) | |
download | gdb-60430eff89ca096d1e5fc83654a29a588426016d.zip gdb-60430eff89ca096d1e5fc83654a29a588426016d.tar.gz gdb-60430eff89ca096d1e5fc83654a29a588426016d.tar.bz2 |
* dwarf2read.c (dwarf2_compute_name): Check that the first
argument is a pointer.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 63814fa..ece5ab7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2010-09-08 Daniel Jacobowitz <dan@codesourcery.com> + * dwarf2read.c (dwarf2_compute_name): Check that the first + argument is a pointer. + +2010-09-08 Daniel Jacobowitz <dan@codesourcery.com> + * dwarf2read.c (read_func_scope, read_structure_type) (read_common_block): Check for a NULL return from new_symbol. 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); } |