aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/f-lang.c15
-rw-r--r--gdb/value.c8
2 files changed, 10 insertions, 13 deletions
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 7ab2a7b..bb17700 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -271,8 +271,8 @@ public:
{
if (inner_p)
{
- gdb_assert (m_mark == nullptr);
- m_mark = value_mark ();
+ gdb_assert (!m_mark.has_value ());
+ m_mark.emplace ();
}
}
@@ -282,9 +282,8 @@ public:
{
if (inner_p)
{
- gdb_assert (m_mark != nullptr);
- value_free_to_mark (m_mark);
- m_mark = nullptr;
+ gdb_assert (m_mark.has_value ());
+ m_mark.reset ();
}
}
@@ -305,9 +304,9 @@ protected:
written. */
LONGEST m_dest_offset;
- /* Set with a call to VALUE_MARK, and then reset after calling
- VALUE_FREE_TO_MARK. */
- struct value *m_mark = nullptr;
+ /* Set and reset to handle removing intermediate values from the
+ value chain. */
+ gdb::optional<scoped_value_mark> m_mark;
};
/* A class used by FORTRAN_VALUE_SUBARRAY when repacking Fortran array
diff --git a/gdb/value.c b/gdb/value.c
index 9517868..1b31f91 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -3879,7 +3879,9 @@ value::fetch_lazy_register ()
frame_info_ptr next_frame;
int regnum;
struct type *type = check_typedef (this->type ());
- struct value *new_val = this, *mark = value_mark ();
+ struct value *new_val = this;
+
+ scoped_value_mark mark;
/* Offsets are not supported here; lazy register values must
refer to the entire register. */
@@ -3983,10 +3985,6 @@ value::fetch_lazy_register ()
frame_debug_printf ("%s", debug_file.c_str ());
}
-
- /* Dispose of the intermediate values. This prevents
- watchpoints from trying to watch the saved frame pointer. */
- value_free_to_mark (mark);
}
/* See value.h. */