aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-10-03 13:51:58 -0600
committerTom Tromey <tromey@adacore.com>2022-10-14 11:21:02 -0600
commit65558ca5df91470521fda6b0bfdfbbdbd37ce4d3 (patch)
tree3136e77c0b2c58fe3d0ece1e4bfa4215498605a8 /gdb/ada-lang.c
parentce6c3d253b97961801bc045d10b7fd022578fd03 (diff)
downloadbinutils-65558ca5df91470521fda6b0bfdfbbdbd37ce4d3.zip
binutils-65558ca5df91470521fda6b0bfdfbbdbd37ce4d3.tar.gz
binutils-65558ca5df91470521fda6b0bfdfbbdbd37ce4d3.tar.bz2
Use scoped_value_mark in more places
I looked at all the spots using value_mark, and converted all the straightforward ones to use scoped_value_mark instead. Regression tested on x86-64 Fedora 34.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 0e3f0da..1f26394 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -7858,7 +7858,6 @@ ada_template_to_fixed_record_type_1 (struct type *type,
CORE_ADDR address, struct value *dval0,
int keep_dynamic_fields)
{
- struct value *mark = value_mark ();
struct value *dval;
struct type *rtype;
int nfields, bit_len;
@@ -7867,6 +7866,8 @@ ada_template_to_fixed_record_type_1 (struct type *type,
int fld_bit_len;
int f;
+ scoped_value_mark mark;
+
/* Compute the number of fields in this record type that are going
to be processed: unless keep_dynamic_fields, this includes only
fields whose position and length are static will be processed. */
@@ -8068,7 +8069,6 @@ ada_template_to_fixed_record_type_1 (struct type *type,
else
rtype->set_length (align_up (rtype->length (), type->length ()));
- value_free_to_mark (mark);
return rtype;
}
@@ -8169,7 +8169,6 @@ static struct type *
to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr,
CORE_ADDR address, struct value *dval0)
{
- struct value *mark = value_mark ();
struct value *dval;
struct type *rtype;
struct type *branch_type;
@@ -8179,6 +8178,7 @@ to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr,
if (variant_field == -1)
return type;
+ scoped_value_mark mark;
if (dval0 == NULL)
{
dval = value_from_contents_and_address (type, valaddr, address);
@@ -8228,7 +8228,6 @@ to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr,
rtype->set_length (rtype->length ()
- type->field (variant_field).type ()->length ());
- value_free_to_mark (mark);
return rtype;
}
@@ -12311,11 +12310,8 @@ should_stop_exception (const struct bp_location *bl)
stop = true;
try
{
- struct value *mark;
-
- mark = value_mark ();
+ scoped_value_mark mark;
stop = value_true (evaluate_expression (ada_loc->excep_cond_expr.get ()));
- value_free_to_mark (mark);
}
catch (const gdb_exception &ex)
{