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:
Pedro Alves 2013-12-06 19:48:54 +00:00
parent 7580e91767
commit 710409a221
6 changed files with 25 additions and 7 deletions

View file

@ -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"));