diff options
author | Pedro Alves <palves@redhat.com> | 2013-12-06 19:48:54 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2013-12-06 19:48:54 +0000 |
commit | 710409a221f27f39d8b8e33c5676c97cb04cf4b8 (patch) | |
tree | 9af164e9fb5ca2f9ac907c6f89304ebe0913a540 /gdb | |
parent | 7580e9176779460e031d82aa1cd5790db53ad27b (diff) | |
download | gdb-710409a221f27f39d8b8e33c5676c97cb04cf4b8.zip gdb-710409a221f27f39d8b8e33c5676c97cb04cf4b8.tar.gz gdb-710409a221f27f39d8b8e33c5676c97cb04cf4b8.tar.bz2 |
New OPTIMIZED_OUT_ERROR error code.
In order to catch <optimized out> errors like we catch <unavailable>
errors, this adds a new OPTIMIZED_OUT_ERROR error code, and throws it
in various places.
gdb/ChangeLog
2013-12-06 Andrew Burgess <aburgess@broadcom.com>
Pedro Alves <palves@redhat.com>
* exceptions.h (errors): Add OPTIMIZED_OUT_ERROR.
* dwarf2loc.c (write_pieced_value): Throw OPTIMIZED_OUT_ERROR.
* frame.c (frame_unwind_register): Throw OPTIMIZED_OUT_ERROR.
* spu-tdep.c (spu_software_single_step): Throw
OPTIMIZED_OUT_ERROR.
* valops.c (value_assign): Throw OPTIMIZED_OUT_ERROR.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 10 | ||||
-rw-r--r-- | gdb/dwarf2loc.c | 7 | ||||
-rw-r--r-- | gdb/exceptions.h | 4 | ||||
-rw-r--r-- | gdb/frame.c | 3 | ||||
-rw-r--r-- | gdb/spu-tdep.c | 5 | ||||
-rw-r--r-- | gdb/valops.c | 3 |
6 files changed, 25 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 464601a..9111314 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2013-12-06 Andrew Burgess <aburgess@broadcom.com> + Pedro Alves <palves@redhat.com> + + * exceptions.h (errors): Add OPTIMIZED_OUT_ERROR. + * dwarf2loc.c (write_pieced_value): Throw OPTIMIZED_OUT_ERROR. + * frame.c (frame_unwind_register): Throw OPTIMIZED_OUT_ERROR. + * spu-tdep.c (spu_software_single_step): Throw + OPTIMIZED_OUT_ERROR. + * valops.c (value_assign): Throw OPTIMIZED_OUT_ERROR. + 2013-12-06 Tom Tromey <tromey@redhat.com> * objfiles.c (free_objfile): Update comment. diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 2d15546..2b1f323 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -1893,9 +1893,10 @@ write_pieced_value (struct value *to, struct value *from) &optim, &unavail)) { if (optim) - error (_("Can't do read-modify-write to " - "update bitfield; containing word has been " - "optimized out")); + throw_error (OPTIMIZED_OUT_ERROR, + _("Can't do read-modify-write to " + "update bitfield; containing word " + "has been optimized out")); if (unavail) throw_error (NOT_AVAILABLE_ERROR, _("Can't do read-modify-write to update " diff --git a/gdb/exceptions.h b/gdb/exceptions.h index a3a28f4..705f1a1 100644 --- a/gdb/exceptions.h +++ b/gdb/exceptions.h @@ -86,6 +86,10 @@ enum errors { traceframe. */ NOT_AVAILABLE_ERROR, + /* Value was optimized out. Note: if the value was a register, this + means the register was not saved in the frame. */ + OPTIMIZED_OUT_ERROR, + /* DW_OP_GNU_entry_value resolving failed. */ NO_ENTRY_VALUE_ERROR, diff --git a/gdb/frame.c b/gdb/frame.c index 576c969..0ba1d4d 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1007,7 +1007,8 @@ frame_unwind_register (struct frame_info *frame, int regnum, gdb_byte *buf) &lval, &addr, &realnum, buf); if (optimized) - error (_("Register %d was not saved"), regnum); + throw_error (OPTIMIZED_OUT_ERROR, + _("Register %d was not saved"), regnum); if (unavailable) throw_error (NOT_AVAILABLE_ERROR, _("Register %d is not available"), regnum); diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index fd54b1e..fdf435e 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -1614,8 +1614,9 @@ spu_software_single_step (struct frame_info *frame) else { if (optim) - error (_("Could not determine address of " - "single-step breakpoint.")); + throw_error (OPTIMIZED_OUT_ERROR, + _("Could not determine address of " + "single-step breakpoint.")); if (unavail) throw_error (NOT_AVAILABLE_ERROR, _("Could not determine address of " diff --git a/gdb/valops.c b/gdb/valops.c index 8e7b16f..d43c758 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1188,7 +1188,8 @@ value_assign (struct value *toval, struct value *fromval) &optim, &unavail)) { if (optim) - error (_("value has been optimized out")); + throw_error (OPTIMIZED_OUT_ERROR, + _("value has been optimized out")); if (unavail) throw_error (NOT_AVAILABLE_ERROR, _("value is not available")); |