+2010-05-04 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+
+ * dwarf2loc.c (read_pieced_value, write_pieced_value,
+ dwarf2_evaluate_loc_desc): Handle not being able to access DWARF
+ registers gracefully.
+
2010-05-04 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
* exec.c (print_section_info): Display entry point without arch
/* 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;
/* 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:
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;