[v3,14/17] Make value_copy also copy the stack data member

Message ID 20210528154648.60881-15-zoran.zaric@amd.com
State New
Headers show
  • DWARF expression evaluator design cleanup
Related show

Commit Message

Simon Marchi via Gdb-patches May 28, 2021, 3:46 p.m.
From: Zoran Zaric <Zoran.Zaric@amd.com>

Fixing a bug where the value_copy function did not copy the stack data
and initialized members of the struct value. This is needed for the
next patch where the DWARF expression evaluator is changed to return a
single struct value object.

        * value.c (value_copy): Change to also copy the stack data
          and initialized members.
 gdb/value.c | 2 ++
 1 file changed, 2 insertions(+)



diff --git a/gdb/value.c b/gdb/value.c
index 9822cec209b..dd18a0509f1 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1692,6 +1692,8 @@  value_copy (struct value *arg)
   val->embedded_offset = value_embedded_offset (arg);
   val->pointed_to_offset = arg->pointed_to_offset;
   val->modifiable = arg->modifiable;
+  val->stack = arg->stack;
+  val->initialized = arg->initialized;
   if (!value_lazy (val))
       memcpy (value_contents_all_raw (val), value_contents_all_raw (arg),