Skip to content

Commit 3360bae

Browse files
committed
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.
1 parent 911627e commit 3360bae

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

gdb/infcall.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,7 @@ get_call_return_value (struct call_return_meta_info *ri)
476476
push_thread_stack_temporary (thr, retval);
477477
}
478478
else
479-
{
480-
retval = allocate_value (ri->value_type);
481-
read_value_memory (retval, 0, 1, ri->struct_addr,
482-
value_contents_raw (retval).data (),
483-
ri->value_type->length ());
484-
}
479+
retval = value_at_non_lval (ri->value_type, ri->struct_addr);
485480
}
486481
else
487482
{

0 commit comments

Comments
 (0)