[PATCH 14/43] Make value_copy also copy the stack data member

Zoran Zaric via Gdb-patches
2021-03-01T14:47:06Z

Fixing a bug where the value_copy function did not copy the stack data
member 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
member.
---
gdb/value.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/gdb/value.c b/gdb/value.c
index bddf9a47923..9f3914a5bc5 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1690,6 +1690,7 @@ 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;
if (!value_lazy (val))
{
memcpy (value_contents_all_raw (val), value_contents_all_raw (arg),
--
2.17.1