aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2003-07-30 20:59:10 +0000
committerMichael Snyder <msnyder@vmware.com>2003-07-30 20:59:10 +0000
commitc48a845bff656d9f07bf53c0004bb0fed62891ae (patch)
treef82e8f84973942a28a40900c23384acc047d41ae /gdb/infcmd.c
parentf0d8db192735d4610f8a1bd3db8b67bf4b13f906 (diff)
downloadgdb-c48a845bff656d9f07bf53c0004bb0fed62891ae.zip
gdb-c48a845bff656d9f07bf53c0004bb0fed62891ae.tar.gz
gdb-c48a845bff656d9f07bf53c0004bb0fed62891ae.tar.bz2
2003-07-30 Michael Snyder <msnyder@redhat.com>
* structs.h (value_being_returned): Add a struct_addr argument. * infcall.c (call_function_by_hand): Pass struct_addr to value_being_returned. * infcmd.c (print_return_value): Pass zero as struct_addr. * values.c (value_being_returned): If struct_addr is passed, use it instead of trying to recover it from the inferior.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index df7d950..c47c9ea 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1077,10 +1077,11 @@ print_return_value (int structure_return, struct type *value_type)
if (!structure_return)
{
- value = value_being_returned (value_type, stop_registers, structure_return);
+ value = value_being_returned (value_type, stop_registers, 0, 0);
stb = ui_out_stream_new (uiout);
ui_out_text (uiout, "Value returned is ");
- ui_out_field_fmt (uiout, "gdb-result-var", "$%d", record_latest_value (value));
+ ui_out_field_fmt (uiout, "gdb-result-var", "$%d",
+ record_latest_value (value));
ui_out_text (uiout, " = ");
value_print (value, stb->stream, 0, Val_no_prettyprint);
ui_out_field_stream (uiout, "return-value", stb);
@@ -1088,20 +1089,23 @@ print_return_value (int structure_return, struct type *value_type)
}
else
{
- /* We cannot determine the contents of the structure because
- it is on the stack, and we don't know where, since we did not
- initiate the call, as opposed to the call_function_by_hand case */
#ifdef VALUE_RETURNED_FROM_STACK
+ /* We cannot determine the contents of the structure because it
+ is on the stack, and we don't know where, since we did not
+ initiate the call, as opposed to the call_function_by_hand
+ case. */
value = 0;
ui_out_text (uiout, "Value returned has type: ");
ui_out_field_string (uiout, "return-type", TYPE_NAME (value_type));
ui_out_text (uiout, ".");
ui_out_text (uiout, " Cannot determine contents\n");
#else
- value = value_being_returned (value_type, stop_registers, structure_return);
+ value = value_being_returned (value_type, stop_registers,
+ structure_return, 0);
stb = ui_out_stream_new (uiout);
ui_out_text (uiout, "Value returned is ");
- ui_out_field_fmt (uiout, "gdb-result-var", "$%d", record_latest_value (value));
+ ui_out_field_fmt (uiout, "gdb-result-var", "$%d",
+ record_latest_value (value));
ui_out_text (uiout, " = ");
value_print (value, stb->stream, 0, Val_no_prettyprint);
ui_out_field_stream (uiout, "return-value", stb);