2003-10-20 Andrew Cagney <cagney@redhat.com>

* values.c (register_value_being_returned): Update comments.  Use
	"gdbarch_return_value" when available.
	(using_struct_return): Ditto.
	(set_return_value): Ditto.  Use "gdbarch_return_value" when
	available..  Print a warning, and not an error, when an unhandled
	return type is encountered.
	* infcmd.c: Include "gdb_assert.h".
	(print_return_value): When gdbarch_return_value_p, and using
	struct return, assume that the value is not available.
	* defs.h (return_value_convention): Define.
	* gdbarch.sh (gdbarch_return_value): New predicate method.
	* gdbarch.h, gdbarch.c: Re-generate
	* ppc-sysv-tdep.c (return_value_convention): Delete definition.

Index: doc/ChangeLog
2003-10-20  Andrew Cagney  <cagney@redhat.com>

	* gdbint.texinfo (Target Architecture Definition): Document
	gdbarch_return_value.  Add cross references from
	USE_STRUCT_CONVENTION, EXTRACT_RETURN_VALUE, and
	STORE_RETURN_VALUE, and from/to EXTRACT_STRUCT_VALUE_ADDRESS.
This commit is contained in:
Andrew Cagney
2003-10-20 15:38:02 +00:00
parent 198beae2cf
commit 92ad9cd90f
10 changed files with 329 additions and 113 deletions

View File

@@ -44,6 +44,7 @@
#include "reggroups.h"
#include "block.h"
#include <ctype.h>
#include "gdb_assert.h"
/* Functions exported for general use, in inferior.h: */
@@ -1079,25 +1080,34 @@ print_return_value (int structure_return, struct type *value_type)
ui_out_field_stream (uiout, "return-value", stb);
ui_out_text (uiout, "\n");
}
else
{
/* FIXME: 2003-09-27: When returning from a nested inferior
function call, it's possible (with no help from the
architecture vector) to locate and return/print a "struct
return" value. This is just a more complicated case of what
is already being done in in the inferior function call code.
In fact, when inferior function calls are made async, this
will likely be made the norm. */
/* 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 */
/* FIXME: 2003-09-27: When returning from a nested inferior function
call, it's possible (with no help from the architecture vector)
to locate and return/print a "struct return" value. This is just
a more complicated case of what is already being done in in the
inferior function call code. In fact, when inferior function
calls are made async, this will likely be made the norm. */
#ifdef DEPRECATED_VALUE_RETURNED_FROM_STACK
value = 0;
#define DEPRECATED_VALUE_RETURNED_FROM_STACK_P 1
#else
#define DEPRECATED_VALUE_RETURNED_FROM_STACK_P 0
#endif
else if (gdbarch_return_value_p (current_gdbarch)
|| DEPRECATED_VALUE_RETURNED_FROM_STACK_P)
/* 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. */
{
gdb_assert (gdbarch_return_value (current_gdbarch, value_type, NULL, NULL, NULL)
== RETURN_VALUE_STRUCT_CONVENTION);
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
return;
}
else
{
if (EXTRACT_STRUCT_VALUE_ADDRESS_P ())
{
CORE_ADDR addr = EXTRACT_STRUCT_VALUE_ADDRESS (stop_registers);
@@ -1133,7 +1143,6 @@ print_return_value (int structure_return, struct type *value_type)
value_print (value, stb->stream, 0, Val_no_prettyprint);
ui_out_field_stream (uiout, "return-value", stb);
ui_out_text (uiout, "\n");
#endif
}
}