From efa86d3c26457c4c619fddef8232738d5091978b Mon Sep 17 00:00:00 2001 From: Zoran Zaric Date: Fri, 26 Feb 2021 13:59:28 +0000 Subject: [PATCH] Make value_copy also copy the stack data member 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 91db66fa3be..2cbaadc3641 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), -- 2.30.2