diff options
author | Matthew Gretton-Dann <matthew.gretton-dann@arm.com> | 2010-05-04 09:54:18 +0000 |
---|---|---|
committer | Matthew Gretton-Dann <matthew.gretton-dann@arm.com> | 2010-05-04 09:54:18 +0000 |
commit | 63b4f126d12867bff0f4e8dd37e4c11129f1ba87 (patch) | |
tree | b03cf518b3fc138880e2077e1386df40c424abc2 /gdb/dwarf2loc.c | |
parent | 2f1bdd26c4065b71245da29262039531a9664aae (diff) | |
download | gdb-63b4f126d12867bff0f4e8dd37e4c11129f1ba87.zip gdb-63b4f126d12867bff0f4e8dd37e4c11129f1ba87.tar.gz gdb-63b4f126d12867bff0f4e8dd37e4c11129f1ba87.tar.bz2 |
* gdb/dwarf2loc.c (read_pieced_value, write_pieced_value,
dwarf2_evaluate_loc_desc): Handle not being able to access DWARF
registers gracefully.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r-- | gdb/dwarf2loc.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 8fbf651..2bd45d9 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -284,8 +284,16 @@ read_pieced_value (struct value *v) /* Big-endian, and we want less than full size. */ reg_offset = register_size (arch, gdb_regnum) - p->size; - get_frame_register_bytes (frame, gdb_regnum, reg_offset, p->size, - contents + offset); + if (gdb_regnum != -1) + { + get_frame_register_bytes (frame, gdb_regnum, reg_offset, + p->size, contents + offset); + } + else + { + error (_("Unable to access DWARF register number %s"), + paddress (arch, p->v.expr.value)); + } } break; @@ -356,8 +364,16 @@ write_pieced_value (struct value *to, struct value *from) /* Big-endian, and we want less than full size. */ reg_offset = register_size (arch, gdb_regnum) - p->size; - put_frame_register_bytes (frame, gdb_regnum, reg_offset, p->size, - contents + offset); + if (gdb_regnum != -1) + { + put_frame_register_bytes (frame, gdb_regnum, reg_offset, + p->size, contents + offset); + } + else + { + error (_("Unable to write to DWARF register number %s"), + paddress (arch, p->v.expr.value)); + } } break; case DWARF_VALUE_MEMORY: @@ -454,7 +470,16 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, struct gdbarch *arch = get_frame_arch (frame); CORE_ADDR dwarf_regnum = dwarf_expr_fetch (ctx, 0); int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch, dwarf_regnum); - retval = value_from_register (SYMBOL_TYPE (var), gdb_regnum, frame); + if (gdb_regnum != -1) + { + retval = value_from_register (SYMBOL_TYPE (var), + gdb_regnum, frame); + } + else + { + error (_("Unable to access DWARF register number %s"), + paddress (arch, dwarf_regnum)); + } } break; |