aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcall.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-09-07 14:01:13 -0600
committerTom Tromey <tromey@adacore.com>2023-01-03 08:45:01 -0700
commit3360bae61faee3b57e4defa33cd7387be5c0dea8 (patch)
tree93b121dd0d88dcda698c2fb65f8ffd6704c62165 /gdb/infcall.c
parent911627e7b1bc682a18ac5a976eb33cd87d73578f (diff)
downloadgdb-3360bae61faee3b57e4defa33cd7387be5c0dea8.zip
gdb-3360bae61faee3b57e4defa33cd7387be5c0dea8.tar.gz
gdb-3360bae61faee3b57e4defa33cd7387be5c0dea8.tar.bz2
Use value_at_non_lval in get_call_return_value
get_call_return_value can handle RETURN_VALUE_STRUCT_CONVENTION, because the call is completely managed by gdb. However, it does not handle variably-sized types correctly. The simplest way to fix this is to use value_at_non_lval, which does type resolution.
Diffstat (limited to 'gdb/infcall.c')
-rw-r--r--gdb/infcall.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c
index acaaf0c..e09904f 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -476,12 +476,7 @@ get_call_return_value (struct call_return_meta_info *ri)
push_thread_stack_temporary (thr, retval);
}
else
- {
- retval = allocate_value (ri->value_type);
- read_value_memory (retval, 0, 1, ri->struct_addr,
- value_contents_raw (retval).data (),
- ri->value_type->length ());
- }
+ retval = value_at_non_lval (ri->value_type, ri->struct_addr);
}
else
{