public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Use value_at_non_lval in get_call_return_value
@ 2023-01-03 16:44 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2023-01-03 16:44 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3360bae61faee3b57e4defa33cd7387be5c0dea8
commit 3360bae61faee3b57e4defa33cd7387be5c0dea8
Author: Tom Tromey <tromey@adacore.com>
Date: Wed Sep 7 14:01:13 2022 -0600
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.
Diff:
---
gdb/infcall.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/gdb/infcall.c b/gdb/infcall.c
index acaaf0c029d..e09904f9a35 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
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-03 16:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-03 16:44 [binutils-gdb] Use value_at_non_lval in get_call_return_value Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).