diff options
author | Tom Tromey <tromey@redhat.com> | 2011-05-17 17:01:46 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2011-05-17 17:01:46 +0000 |
commit | 9ff3b74fdb6c74f814fa23abc12dbcb62bbb3028 (patch) | |
tree | 3072ff4ec09e84603c235db7c9eabffdb0f76f38 | |
parent | 4e5115238452804a673f05409669fe3dc8cd7cb1 (diff) | |
download | gdb-9ff3b74fdb6c74f814fa23abc12dbcb62bbb3028.zip gdb-9ff3b74fdb6c74f814fa23abc12dbcb62bbb3028.tar.gz gdb-9ff3b74fdb6c74f814fa23abc12dbcb62bbb3028.tar.bz2 |
* dwarf2read.c (dwarf2_get_die_type): Call
get_die_type_at_offset.
* dwarf2expr.c (dwarf_get_base_type): Handle NULL return from
get_base_type function.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/dwarf2expr.c | 2 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 16 |
3 files changed, 10 insertions, 15 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4b8a05f..0e8a04f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2011-05-17 Tom Tromey <tromey@redhat.com> + + * dwarf2read.c (dwarf2_get_die_type): Call + get_die_type_at_offset. + * dwarf2expr.c (dwarf_get_base_type): Handle NULL return from + get_base_type function. + 2011-05-17 Tomas Martinec <fyzmat@gmail.com> * infrun.c (handle_inferior_event) <handling deferred step>: Clear diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c index 1fe8b79..5cd33a6 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c @@ -447,6 +447,8 @@ dwarf_get_base_type (struct dwarf_expr_context *ctx, ULONGEST die, int size) if (ctx->get_base_type) { result = ctx->get_base_type (ctx, die); + if (result == NULL) + error (_("Could not find type for DW_OP_GNU_const_type")); if (size != 0 && TYPE_LENGTH (result) != size) error (_("DW_OP_GNU_const_type has different sizes for type and data")); } diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 22643c5..6558bfe 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -13671,22 +13671,8 @@ struct type * dwarf2_get_die_type (unsigned int die_offset, struct dwarf2_per_cu_data *per_cu) { - struct dwarf2_cu *cu = per_cu->cu; - struct die_info *die; - struct type *result; - dw2_setup (per_cu->objfile); - - die = follow_die_offset (die_offset, &cu); - if (!die) - error (_("Dwarf Error: Cannot find DIE at 0x%x referenced in module %s"), - die_offset, per_cu->cu->objfile->name); - - result = get_die_type (die, cu); - if (result == NULL) - result = read_type_die_1 (die, cu); - - return result; + return get_die_type_at_offset (die_offset, per_cu); } /* Follow the signature attribute ATTR in SRC_DIE. |