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.
This commit is contained in:
parent
7580e91767
commit
710409a221
6 changed files with 25 additions and 7 deletions
|
@ -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>
|
2013-12-06 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* objfiles.c (free_objfile): Update comment.
|
* objfiles.c (free_objfile): Update comment.
|
||||||
|
|
|
@ -1893,9 +1893,10 @@ write_pieced_value (struct value *to, struct value *from)
|
||||||
&optim, &unavail))
|
&optim, &unavail))
|
||||||
{
|
{
|
||||||
if (optim)
|
if (optim)
|
||||||
error (_("Can't do read-modify-write to "
|
throw_error (OPTIMIZED_OUT_ERROR,
|
||||||
"update bitfield; containing word has been "
|
_("Can't do read-modify-write to "
|
||||||
"optimized out"));
|
"update bitfield; containing word "
|
||||||
|
"has been optimized out"));
|
||||||
if (unavail)
|
if (unavail)
|
||||||
throw_error (NOT_AVAILABLE_ERROR,
|
throw_error (NOT_AVAILABLE_ERROR,
|
||||||
_("Can't do read-modify-write to update "
|
_("Can't do read-modify-write to update "
|
||||||
|
|
|
@ -86,6 +86,10 @@ enum errors {
|
||||||
traceframe. */
|
traceframe. */
|
||||||
NOT_AVAILABLE_ERROR,
|
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. */
|
/* DW_OP_GNU_entry_value resolving failed. */
|
||||||
NO_ENTRY_VALUE_ERROR,
|
NO_ENTRY_VALUE_ERROR,
|
||||||
|
|
||||||
|
|
|
@ -1007,7 +1007,8 @@ frame_unwind_register (struct frame_info *frame, int regnum, gdb_byte *buf)
|
||||||
&lval, &addr, &realnum, buf);
|
&lval, &addr, &realnum, buf);
|
||||||
|
|
||||||
if (optimized)
|
if (optimized)
|
||||||
error (_("Register %d was not saved"), regnum);
|
throw_error (OPTIMIZED_OUT_ERROR,
|
||||||
|
_("Register %d was not saved"), regnum);
|
||||||
if (unavailable)
|
if (unavailable)
|
||||||
throw_error (NOT_AVAILABLE_ERROR,
|
throw_error (NOT_AVAILABLE_ERROR,
|
||||||
_("Register %d is not available"), regnum);
|
_("Register %d is not available"), regnum);
|
||||||
|
|
|
@ -1614,7 +1614,8 @@ spu_software_single_step (struct frame_info *frame)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (optim)
|
if (optim)
|
||||||
error (_("Could not determine address of "
|
throw_error (OPTIMIZED_OUT_ERROR,
|
||||||
|
_("Could not determine address of "
|
||||||
"single-step breakpoint."));
|
"single-step breakpoint."));
|
||||||
if (unavail)
|
if (unavail)
|
||||||
throw_error (NOT_AVAILABLE_ERROR,
|
throw_error (NOT_AVAILABLE_ERROR,
|
||||||
|
|
|
@ -1188,7 +1188,8 @@ value_assign (struct value *toval, struct value *fromval)
|
||||||
&optim, &unavail))
|
&optim, &unavail))
|
||||||
{
|
{
|
||||||
if (optim)
|
if (optim)
|
||||||
error (_("value has been optimized out"));
|
throw_error (OPTIMIZED_OUT_ERROR,
|
||||||
|
_("value has been optimized out"));
|
||||||
if (unavail)
|
if (unavail)
|
||||||
throw_error (NOT_AVAILABLE_ERROR,
|
throw_error (NOT_AVAILABLE_ERROR,
|
||||||
_("value is not available"));
|
_("value is not available"));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue