This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch/rfc] Deprecate USE_STRUCT_CONVENTION
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 13 Jun 2004 14:25:06 -0400
- Subject: [patch/rfc] Deprecate USE_STRUCT_CONVENTION
Hello,
Now that return_value() covers edge cases such as
RETURN_VALUE_ABI_RETURNS_ADDRESS and RETURN_VALUE_ABI_PRESERVES_ADDRESS,
the old USE_STRUCT_CONVENTION is really redundant. This deprecates that
method making it clear that it shouldn't be used in new architectures.
I'll look to commit in a week,
Andrew
Index: ChangeLog
2004-06-13 Andrew Cagney <cagney@gnu.org>
* gdbarch.sh (DEPRECATED_USE_STRUCT_CONVENTION): Deprecated.
* gdbarch.h, gdbarch.c: Re-generate.
* values.c (using_struct_return): Update call.
* mcore-tdep.c: Update comment.
* infcall.c (call_function_by_hand): Update comment.
Index: doc/ChangeLog
2004-06-13 Andrew Cagney <cagney@gnu.org>
* gdbint.texinfo (Target Architecture Definition): Deprecate
USE_STRUCT_CONVENTION.
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.325
diff -p -u -r1.325 gdbarch.sh
--- gdbarch.sh 13 Jun 2004 17:04:49 -0000 1.325
+++ gdbarch.sh 13 Jun 2004 18:19:49 -0000
@@ -543,14 +543,16 @@ F:DEPRECATED_STORE_STRUCT_RETURN:void:de
M::enum return_value_convention:return_value:struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf:valtype, regcache, readbuf, writebuf
-# The deprecated methods EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE and
-# USE_STRUCT_CONVENTION have all been folded into 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:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, struct regcache *regcache, void *valbuf:type, regcache, valbuf:::legacy_extract_return_value::0
f:STORE_RETURN_VALUE:void:store_return_value:struct type *type, struct regcache *regcache, const void *valbuf:type, regcache, valbuf:::legacy_store_return_value::0
f:DEPRECATED_EXTRACT_RETURN_VALUE:void:deprecated_extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf
f:DEPRECATED_STORE_RETURN_VALUE:void:deprecated_store_return_value:struct type *type, char *valbuf:type, valbuf
-f:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::generic_use_struct_convention::0
+f:DEPRECATED_USE_STRUCT_CONVENTION:int:deprecated_use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::generic_use_struct_convention::0
# As of 2004-01-17 only the 32-bit SPARC ABI has been identified as an
# ABI suitable for the implementation of a robust extract
Index: infcall.c
===================================================================
RCS file: /cvs/src/src/gdb/infcall.c,v
retrieving revision 1.50
diff -p -u -r1.50 infcall.c
--- infcall.c 12 Jun 2004 18:02:29 -0000 1.50
+++ infcall.c 13 Jun 2004 18:19:50 -0000
@@ -953,9 +953,9 @@ the function call).", name);
else
{
/* NOTE: cagney/2003-10-20: Unlike "gdbarch_return_value", the
- EXTRACT_RETURN_VALUE and USE_STRUCT_CONVENTION methods do
- not handle the edge case of a function returning a small
- structure / union in registers. */
+ EXTRACT_RETURN_VALUE and DEPRECATED_USE_STRUCT_CONVENTION
+ methods do not handle the edge case of a function returning
+ a small structure / union in registers. */
retval = allocate_value (value_type);
EXTRACT_RETURN_VALUE (value_type, retbuf, VALUE_CONTENTS_RAW (retval));
}
Index: mcore-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mcore-tdep.c,v
retrieving revision 1.90
diff -p -u -r1.90 mcore-tdep.c
--- mcore-tdep.c 13 Jun 2004 13:49:53 -0000 1.90
+++ mcore-tdep.c 13 Jun 2004 18:19:51 -0000
@@ -916,11 +916,11 @@ mcore_push_return_address (CORE_ADDR pc,
argument.
For gdb, this leaves us two routes, based on what
- USE_STRUCT_CONVENTION (mcore_use_struct_convention) returns. If
- this macro returns 1, gdb will call STORE_STRUCT_RETURN to store
- the return value.
+ DEPRECATED_USE_STRUCT_CONVENTION (mcore_use_struct_convention)
+ returns. If this macro returns 1, gdb will call
+ STORE_STRUCT_RETURN to store the return value.
- If USE_STRUCT_CONVENTION returns 0, then gdb uses
+ If DEPRECATED_USE_STRUCT_CONVENTION returns 0, then gdb uses
STORE_RETURN_VALUE and EXTRACT_RETURN_VALUE to store/fetch the
functions return value. */
Index: values.c
===================================================================
RCS file: /cvs/src/src/gdb/values.c,v
retrieving revision 1.68
diff -p -u -r1.68 values.c
--- values.c 13 Jun 2004 15:15:59 -0000 1.68
+++ values.c 13 Jun 2004 18:19:51 -0000
@@ -1256,7 +1256,7 @@ using_struct_return (struct type *value_
if (code == TYPE_CODE_STRUCT
|| code == TYPE_CODE_UNION
|| code == TYPE_CODE_ARRAY)
- return USE_STRUCT_CONVENTION (gcc_p, value_type);
+ return DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type);
else
return 0;
}
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.208
diff -p -u -r1.208 gdbint.texinfo
--- doc/gdbint.texinfo 13 Jun 2004 13:42:33 -0000 1.208
+++ doc/gdbint.texinfo 13 Jun 2004 18:19:54 -0000
@@ -3893,8 +3893,8 @@ frame. The value returned must match th
previously saved using @code{SAVE_DUMMY_FRAME_TOS}.
@xref{SAVE_DUMMY_FRAME_TOS}.
-@item USE_STRUCT_CONVENTION (@var{gcc_p}, @var{type})
-@findex USE_STRUCT_CONVENTION
+@item DEPRECATED_USE_STRUCT_CONVENTION (@var{gcc_p}, @var{type})
+@findex DEPRECATED_USE_STRUCT_CONVENTION
If defined, this must be an expression that is nonzero if a value of the
given @var{type} being returned from a function must have space
allocated for it on the stack. @var{gcc_p} is true if the function