#include "gdb_obstack.h"
#include "objfiles.h"
#include "python/python.h"
-#include "wrapper.h"
#include "gdb_assert.h"
/* Make sure it's not lazy, so that after the target stops again we
have a non-lazy previous value to compare with. */
- if (result != NULL
- && (!value_lazy (result) || gdb_value_fetch_lazy (result)))
- *valp = result;
+ if (result != NULL)
+ {
+ if (!value_lazy (result))
+ *valp = result;
+ else
+ {
+ volatile struct gdb_exception except;
+
+ TRY_CATCH (except, RETURN_MASK_ERROR)
+ {
+ value_fetch_lazy (result);
+ *valp = result;
+ }
+ }
+ }
if (val_chain)
{