(extract_return_value, store_return_value): Remove.
(return_value): Remove default implementation.
* gdbarch.c, gdbarch.h: Regenerate.
* stack.c (return_command): Remove compatibility hack.
* arch-utils.c (legacy_return_value): Remove.
* arch-utils.h (legacy_return_value): Likewise.
* arch-utils.c (always_use_struct_convention): Remove.
* arch-utils.h (always_use_struct_convention): Likewise.
* value.c (generic_use_struct_convention): Remove.
* defs.h (generic_use_struct_convention): Likewise.
doc/ChangeLog:
* gdbint.texi (Target Conditionals): Remove documentation
of and references to DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS,
gdbarch_extract_return_value, and gdbarch_store_return_value.
2007-10-12 Ulrich Weigand <uweigand@de.ibm.com>
+ * gdbarch.sh (deprecated_use_struct_convention): Remove.
+ (extract_return_value, store_return_value): Remove.
+ (return_value): Remove default implementation.
+ * gdbarch.c, gdbarch.h: Regenerate.
+
+ * stack.c (return_command): Remove compatibility hack.
+ * arch-utils.c (legacy_return_value): Remove.
+ * arch-utils.h (legacy_return_value): Likewise.
+
+ * arch-utils.c (always_use_struct_convention): Remove.
+ * arch-utils.h (always_use_struct_convention): Likewise.
+ * value.c (generic_use_struct_convention): Remove.
+ * defs.h (generic_use_struct_convention): Likewise.
+
+2007-10-12 Ulrich Weigand <uweigand@de.ibm.com>
+
* avr-tdep.c (avr_return_value): New function.
(avr_gdbarch_init): Call set_gdbarch_return_value instead of
set_gdbarch_extract_return_value.
#include "floatformat.h"
-int
-always_use_struct_convention (int gcc_p, struct type *value_type)
-{
- return 1;
-}
-
-enum return_value_convention
-legacy_return_value (struct gdbarch *gdbarch, struct type *valtype,
- struct regcache *regcache, gdb_byte *readbuf,
- const gdb_byte *writebuf)
-{
- /* NOTE: cagney/2004-06-13: The gcc_p parameter to
- USE_STRUCT_CONVENTION isn't used. */
- int struct_return = ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT
- || TYPE_CODE (valtype) == TYPE_CODE_UNION
- || TYPE_CODE (valtype) == TYPE_CODE_ARRAY)
- && gdbarch_deprecated_use_struct_convention
- (gdbarch, 0, valtype));
-
- if (writebuf != NULL)
- {
- gdb_assert (!struct_return);
- /* NOTE: cagney/2004-06-13: See stack.c:return_command. Old
- architectures don't expect store_return_value to handle small
- structures. Should not be called with such types. */
- gdb_assert (TYPE_CODE (valtype) != TYPE_CODE_STRUCT
- && TYPE_CODE (valtype) != TYPE_CODE_UNION);
- gdbarch_store_return_value (gdbarch, valtype, regcache, writebuf);
- }
-
- if (readbuf != NULL)
- {
- gdb_assert (!struct_return);
- gdbarch_extract_return_value (gdbarch, valtype, regcache, readbuf);
- }
-
- if (struct_return)
- return RETURN_VALUE_STRUCT_CONVENTION;
- else
- return RETURN_VALUE_REGISTER_CONVENTION;
-}
int
legacy_register_sim_regno (int regnum)
/* gdbarch trace variable */
extern int gdbarch_debug;
-/* An implementation of return_value that props up architectures still
- using USE_STRUCT_RETURN, gdbarch_extract_return_value and
- store_return_value. See also the hacks in "stack.c". */
-enum return_value_convention legacy_return_value (struct gdbarch *gdbarch,
- struct type *valtype,
- struct regcache *regcache,
- gdb_byte *readbuf,
- const gdb_byte *writebuf);
-
-/* To return any structure or union type by value, store it at the
- address passed as an invisible first argument to the function. */
-extern gdbarch_deprecated_use_struct_convention_ftype always_use_struct_convention;
-
/* The only possible cases for inner_than. */
extern int core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs);
extern int core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs);
extern void set_demangling_style (char *);
-/* From tm.h */
-
-struct type;
-typedef int (use_struct_convention_fn) (int gcc_p, struct type * value_type);
-extern use_struct_convention_fn generic_use_struct_convention;
-
\f
/* Annotation stuff. */
2007-10-12 Ulrich Weigand <uweigand@de.ibm.com>
+ * gdbint.texi (Target Conditionals): Remove documentation
+ of and references to DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS,
+ gdbarch_extract_return_value, and gdbarch_store_return_value.
+
+2007-10-12 Ulrich Weigand <uweigand@de.ibm.com>
+
* gdbint.texi (Target Conditionals): Remove documentation of
and references to DEPRECATED_REG_STRUCT_HAS_ADDR.
@page
@tex
\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.269 $} % For use in headers, footers too
+\xdef\manvers{\$Revision: 1.270 $} % For use in headers, footers too
{\parskip=0pt
\hfill Cygnus Solutions\par
\hfill \manvers\par
Convert ECOFF register number @var{ecoff_regnr} into @value{GDBN} regnum. If
not defined, no conversion will be performed.
-@item void gdbarch_extract_return_value (@var{gdbarch}, @var{type}, @var{regbuf}, @var{valbuf})
-@findex gdbarch_extract_return_value
-Define this to extract a function's return value of type @var{type} from
-the raw register state @var{regbuf} and copy that, in virtual format,
-into @var{valbuf}.
-
-This method has been deprecated in favour of @code{gdbarch_return_value}
-(@pxref{gdbarch_return_value}).
-
-@item DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(@var{regbuf})
-@findex DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
-@anchor{DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS}
-When defined, extract from the array @var{regbuf} (containing the raw
-register state) the @code{CORE_ADDR} at which a function should return
-its structure value.
-
-@xref{gdbarch_return_value}.
-
-@item DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()
-@findex DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
-Predicate for @code{DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS}.
-
@item DEPRECATED_FP_REGNUM
@findex DEPRECATED_FP_REGNUM
If the virtual frame pointer is kept in a register, then define this
@var{readbuf} (@var{regcache} contains a copy of the registers from the
just returned function).
-@xref{DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS}, for a description of how
-return-values that use the struct convention are handled.
-
@emph{Maintainer note: This method replaces separate predicate, extract,
store methods. By having only one method, the logic needed to determine
the return-value convention need only be implemented in one place. If
Use this function to convert stab register @var{stab_regnr} into @value{GDBN}
regnum. If not defined, no conversion will be done.
-@item void gdbarch_store_return_value (@var{gdbarch}, @var{type}, @var{regcache}, @var{valbuf})
-@findex gdbarch_store_return_value
-A function that writes the function return value, found in
-@var{valbuf}, into the @var{regcache}. @var{type} is the type of the
-value that is to be returned.
-
-This method has been deprecated in favour of @code{gdbarch_return_value}
-(@pxref{gdbarch_return_value}).
-
@item SYMBOL_RELOADING_DEFAULT
@findex SYMBOL_RELOADING_DEFAULT
The default value of the ``symbol-reloading'' variable. (Never defined in
gdbarch_address_to_pointer_ftype *address_to_pointer;
gdbarch_integer_to_address_ftype *integer_to_address;
gdbarch_return_value_ftype *return_value;
- gdbarch_extract_return_value_ftype *extract_return_value;
- gdbarch_store_return_value_ftype *store_return_value;
- gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
gdbarch_skip_prologue_ftype *skip_prologue;
gdbarch_inner_than_ftype *inner_than;
gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
0, /* address_to_pointer */
0, /* integer_to_address */
0, /* return_value */
- 0, /* extract_return_value */
- 0, /* store_return_value */
- 0, /* deprecated_use_struct_convention */
0, /* skip_prologue */
0, /* inner_than */
0, /* breakpoint_from_pc */
current_gdbarch->value_from_register = default_value_from_register;
current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
- current_gdbarch->return_value = legacy_return_value;
- current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention;
current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
current_gdbarch->remote_register_number = default_remote_register_number;
/* Skip verify of address_to_pointer, invalid_p == 0 */
/* Skip verify of integer_to_address, has predicate */
/* Skip verify of return_value, has predicate */
- /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
if (current_gdbarch->skip_prologue == 0)
fprintf_unfiltered (log, "\n\tskip_prologue");
if (current_gdbarch->inner_than == 0)
"gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
paddr_nz (current_gdbarch->deprecated_function_start_offset));
fprintf_unfiltered (file,
- "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
- (long) current_gdbarch->deprecated_use_struct_convention);
- fprintf_unfiltered (file,
"gdbarch_dump: double_bit = %s\n",
paddr_d (current_gdbarch->double_bit));
fprintf_unfiltered (file,
"gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
(long) current_gdbarch->elf_make_msymbol_special);
fprintf_unfiltered (file,
- "gdbarch_dump: extract_return_value = <0x%lx>\n",
- (long) current_gdbarch->extract_return_value);
- fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
gdbarch_fetch_pointer_argument_p (current_gdbarch));
fprintf_unfiltered (file,
"gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
(long) current_gdbarch->stabs_argument_has_addr);
fprintf_unfiltered (file,
- "gdbarch_dump: store_return_value = <0x%lx>\n",
- (long) current_gdbarch->store_return_value);
- fprintf_unfiltered (file,
"gdbarch_dump: target_desc = %s\n",
paddr_d ((long) current_gdbarch->target_desc));
fprintf_unfiltered (file,
gdbarch_return_value_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- return gdbarch->return_value != legacy_return_value;
+ return gdbarch->return_value != NULL;
}
enum return_value_convention
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->return_value != NULL);
- /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
gdbarch->return_value = return_value;
}
-void
-gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->extract_return_value != NULL);
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
- gdbarch->extract_return_value (type, regcache, valbuf);
-}
-
-void
-set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
- gdbarch_extract_return_value_ftype extract_return_value)
-{
- gdbarch->extract_return_value = extract_return_value;
-}
-
-void
-gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->store_return_value != NULL);
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
- gdbarch->store_return_value (type, regcache, valbuf);
-}
-
-void
-set_gdbarch_store_return_value (struct gdbarch *gdbarch,
- gdbarch_store_return_value_ftype store_return_value)
-{
- gdbarch->store_return_value = store_return_value;
-}
-
-int
-gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->deprecated_use_struct_convention != NULL);
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n");
- return gdbarch->deprecated_use_struct_convention (gcc_p, value_type);
-}
-
-void
-set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch,
- gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention)
-{
- gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
-}
-
CORE_ADDR
gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
{
/* It has been suggested that this, well actually its predecessor,
should take the type/value of the function to be called and not the
- return type. This is left as an exercise for the reader.
- NOTE: cagney/2004-06-13: The function stack.c:return_command uses
- the predicate with default hack to avoid calling store_return_value
- (via legacy_return_value), when a small struct is involved. */
+ return type. This is left as an exercise for the reader. */
extern int gdbarch_return_value_p (struct gdbarch *gdbarch);
extern enum return_value_convention gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf);
extern void set_gdbarch_return_value (struct gdbarch *gdbarch, gdbarch_return_value_ftype *return_value);
-/* The deprecated methods extract_return_value, store_return_value,
- DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS and
- deprecated_use_struct_convention have all been folded into
- RETURN_VALUE. */
-
-typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regcache *regcache, gdb_byte *valbuf);
-extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf);
-extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value);
-
-typedef void (gdbarch_store_return_value_ftype) (struct type *type, struct regcache *regcache, const gdb_byte *valbuf);
-extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf);
-extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value);
-
-typedef int (gdbarch_deprecated_use_struct_convention_ftype) (int gcc_p, struct type *value_type);
-extern int gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type);
-extern void set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention);
-
typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip);
extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue);
# should take the type/value of the function to be called and not the
# return type. This is left as an exercise for the reader.
-# NOTE: cagney/2004-06-13: The function stack.c:return_command uses
-# the predicate with default hack to avoid calling store_return_value
-# (via legacy_return_value), when a small struct is involved.
-
-M::enum return_value_convention:return_value:struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf:valtype, regcache, readbuf, writebuf::legacy_return_value
-
-# The deprecated methods extract_return_value, store_return_value,
-# DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS and
-# deprecated_use_struct_convention have all been folded into
-# RETURN_VALUE.
-
-f::void:extract_return_value:struct type *type, struct regcache *regcache, gdb_byte *valbuf:type, regcache, valbuf:0
-f::void:store_return_value:struct type *type, struct regcache *regcache, const gdb_byte *valbuf:type, regcache, valbuf:0
-f::int:deprecated_use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type::generic_use_struct_convention::0
+M::enum return_value_convention:return_value:struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf:valtype, regcache, readbuf, writebuf
f::CORE_ADDR:skip_prologue:CORE_ADDR ip:ip:0:0
f::int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs:0:0
is discarded, side effects such as "return i++" still
occur. */
return_value = NULL;
- /* FIXME: cagney/2004-01-17: If the architecture implements both
- return_value and extract_returned_value_address, should allow
- "return" to work - don't set return_value to NULL. */
- else if (!gdbarch_return_value_p (current_gdbarch)
- && (TYPE_CODE (return_type) == TYPE_CODE_STRUCT
- || TYPE_CODE (return_type) == TYPE_CODE_UNION))
- {
- /* NOTE: cagney/2003-10-20: Compatibility hack for legacy
- code. Old architectures don't expect gdbarch_store_return_value
- to be called with with a small struct that needs to be
- stored in registers. Don't start doing it now. */
- query_prefix = "\
-A structure or union return type is not supported by this architecture.\n\
-If you continue, the return value that you specified will be ignored.\n";
- return_value = NULL;
- }
else if (using_struct_return (return_type))
{
query_prefix = "\
}
\f
-/* Should we use DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS instead of
- gdbarch_extract_return_value? GCC_P is true if compiled with gcc and TYPE
- is the type (which is known to be struct, union or array).
-
- On most machines, the struct convention is used unless we are
- using gcc and the type is of a special size. */
-/* As of about 31 Mar 93, GCC was changed to be compatible with the
- native compiler. GCC 2.3.3 was the last release that did it the
- old way. Since gcc2_compiled was not changed, we have no
- way to correctly win in all cases, so we just do the right thing
- for gcc1 and for gcc2 after this change. Thus it loses for gcc
- 2.0-2.3.3. This is somewhat unfortunate, but changing gcc2_compiled
- would cause more chaos than dealing with some struct returns being
- handled wrong. */
-/* NOTE: cagney/2004-06-13: Deleted check for "gcc_p". GCC 1.x is
- dead. */
-
-int
-generic_use_struct_convention (int gcc_p, struct type *value_type)
-{
- return !(TYPE_LENGTH (value_type) == 1
- || TYPE_LENGTH (value_type) == 2
- || TYPE_LENGTH (value_type) == 4
- || TYPE_LENGTH (value_type) == 8);
-}
-
/* Return true if the function returning the specified type is using
the convention of returning structures in memory (passing in the
address as a hidden first parameter). */