TRY
{
struct value *res_val;
- struct cleanup *cleanup = make_cleanup_value_free_to_mark (value_mark ());
+ scoped_value_mark free_values;
res_val = value_ind (((value_object *) self)->value);
result = value_to_value_object (res_val);
- do_cleanups (cleanup);
}
CATCH (except, RETURN_MASK_ALL)
{
TRY
{
struct value *self_val, *res_val;
- struct cleanup *cleanup = make_cleanup_value_free_to_mark (value_mark ());
+ scoped_value_mark free_values;
self_val = ((value_object *) self)->value;
switch (TYPE_CODE (check_typedef (value_type (self_val))))
}
result = value_to_value_object (res_val);
- do_cleanups (cleanup);
}
CATCH (except, RETURN_MASK_ALL)
{
TRY
{
struct value *self_val;
- struct cleanup *cleanup = make_cleanup_value_free_to_mark (value_mark ());
+ scoped_value_mark free_values;
self_val = ((value_object *) self)->value;
result = value_to_value_object (value_ref (self_val));
-
- do_cleanups (cleanup);
}
CATCH (except, RETURN_MASK_ALL)
{
TRY
{
struct value *self_val, *res_val;
- struct cleanup *cleanup = make_cleanup_value_free_to_mark (value_mark ());
+ scoped_value_mark free_values;
self_val = ((value_object *) self)->value;
res_val = make_cv_value (1, 0, self_val);
result = value_to_value_object (res_val);
-
- do_cleanups (cleanup);
}
CATCH (except, RETURN_MASK_ALL)
{
TRY
{
struct value *res_val;
- struct cleanup *cleanup
- = make_cleanup_value_free_to_mark (value_mark ());
+ scoped_value_mark free_values;
res_val = value_addr (val_obj->value);
val_obj->address = value_to_value_object (res_val);
- do_cleanups (cleanup);
}
CATCH (except, RETURN_MASK_ALL)
{
TRY
{
struct value *val = obj->value;
- struct cleanup *cleanup = make_cleanup_value_free_to_mark (value_mark ());
+ scoped_value_mark free_values;
type = value_type (val);
type = check_typedef (type);
/* Re-use object's static type. */
type = NULL;
}
-
- do_cleanups (cleanup);
}
CATCH (except, RETURN_MASK_ALL)
{
TRY
{
- struct cleanup *cleanup = make_cleanup_value_free_to_mark (value_mark ());
+ scoped_value_mark free_values;
if (TYPE_CODE (value_type (value)) == TYPE_CODE_PTR)
value = value_ind (value);
str_obj = gdbpy_create_lazy_string_object (value_address (value), length,
user_encoding,
value_type (value));
-
- do_cleanups (cleanup);
}
CATCH (except, RETURN_MASK_ALL)
{
{
struct value *val = ((value_object *) self)->value;
struct value *res_val;
- struct cleanup *cleanup = make_cleanup_value_free_to_mark (value_mark ());
+ scoped_value_mark free_values;
if (op == UNOP_DYNAMIC_CAST)
res_val = value_dynamic_cast (type, val);
}
result = value_to_value_object (res_val);
- do_cleanups (cleanup);
}
CATCH (except, RETURN_MASK_ALL)
{
TRY
{
struct value *tmp = self_value->value;
- struct cleanup *cleanup = make_cleanup_value_free_to_mark (value_mark ());
struct value *res_val = NULL;
+ scoped_value_mark free_values;
if (field)
res_val = value_struct_elt (&tmp, NULL, field.get (), NULL,
if (res_val)
result = value_to_value_object (res_val);
- do_cleanups (cleanup);
}
CATCH (ex, RETURN_MASK_ALL)
{
TRY
{
- struct cleanup *cleanup = make_cleanup_value_free_to_mark (mark);
+ scoped_value_mark free_values;
struct value *return_value;
return_value = call_function_by_hand (function, args_count, vargs);
result = value_to_value_object (return_value);
- do_cleanups (cleanup);
}
CATCH (except, RETURN_MASK_ALL)
{
PyObject *result = NULL;
struct value *arg1, *arg2;
- struct cleanup *cleanup = make_cleanup_value_free_to_mark (value_mark ());
struct value *res_val = NULL;
enum exp_opcode op = OP_NULL;
int handled = 0;
+ scoped_value_mark free_values;
+
/* If the gdb.Value object is the second operand, then it will be
passed to us as the OTHER argument, and SELF will be an entirely
different kind of object, altogether. Because of this, we can't
python as well. */
arg1 = convert_value_from_python (self);
if (arg1 == NULL)
- {
- do_cleanups (cleanup);
- return NULL;
- }
+ return NULL;
arg2 = convert_value_from_python (other);
if (arg2 == NULL)
- {
- do_cleanups (cleanup);
- return NULL;
- }
+ return NULL;
switch (opcode)
{
if (res_val)
result = value_to_value_object (res_val);
- do_cleanups (cleanup);
return result;
}
TRY
{
/* Perhaps overkill, but consistency has some virtue. */
- struct cleanup *cleanup = make_cleanup_value_free_to_mark (value_mark ());
+ scoped_value_mark free_values;
struct value *val;
val = value_neg (((value_object *) self)->value);
result = value_to_value_object (val);
- do_cleanups (cleanup);
}
CATCH (except, RETURN_MASK_ALL)
{
TRY
{
- struct cleanup *cleanup = make_cleanup_value_free_to_mark (value_mark ());
+ scoped_value_mark free_values;
if (value_less (value, value_zero (value_type (value), not_lval)))
isabs = 0;
-
- do_cleanups (cleanup);
}
CATCH (except, RETURN_MASK_ALL)
{
int result;
struct value *value_other;
struct value *value_self;
- struct value *mark = value_mark ();
struct cleanup *cleanup;
+ scoped_value_mark free_values;
+
value_other = convert_value_from_python (other);
if (value_other == NULL)
return -1;
- cleanup = make_cleanup_value_free_to_mark (mark);
-
value_self = ((value_object *) self)->value;
switch (op)
break;
}
- do_cleanups (cleanup);
return result;
}