diff options
author | Mark Alexander <marka@cygnus> | 1998-04-16 02:10:26 +0000 |
---|---|---|
committer | Mark Alexander <marka@cygnus> | 1998-04-16 02:10:26 +0000 |
commit | 4a3f4c4ca04c5738698bbd392363bec5ea71d838 (patch) | |
tree | 262a39cf2292caeb7c1ddf3f86af45a018d7196c /gdb | |
parent | c58fa2cc43ed06269fa16cd31abe5650d39c23a3 (diff) | |
download | ppe42-binutils-4a3f4c4ca04c5738698bbd392363bec5ea71d838.tar.gz ppe42-binutils-4a3f4c4ca04c5738698bbd392363bec5ea71d838.zip |
* sparc-tdep.c (SPARC_HAS_FPU): Define.
(sparc_extract_return_value): New function, required to handle
machines without floating point.
(sparc_store_return_value): Ditto.
* config/sparc/tm-sparc.h (EXTRACT_RETURN_VALUE): Call
sparc_extract_return_value instead of using inline code.
(sparc_extract_return_value): Declare.
(STORE_RETURN_VALUE): Call sparc_store_return_value instead
of using inline code.
(sparc_store_return_value): Declare.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 13 | ||||
-rw-r--r-- | gdb/config/sparc/tm-sparc.h | 45 |
2 files changed, 25 insertions, 33 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fbc858adc0..aabd63a985 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,16 @@ +Wed Apr 15 18:59:48 1998 Mark Alexander <marka@cygnus.com> + + * sparc-tdep.c (SPARC_HAS_FPU): Define. + (sparc_extract_return_value): New function, required to handle + machines without floating point. + (sparc_store_return_value): Ditto. + * config/sparc/tm-sparc.h (EXTRACT_RETURN_VALUE): Call + sparc_extract_return_value instead of using inline code. + (sparc_extract_return_value): Declare. + (STORE_RETURN_VALUE): Call sparc_store_return_value instead + of using inline code. + (sparc_store_return_value): Declare. + Wed Apr 15 12:19:42 1998 Martin M. Hunt <hunt@cygnus.com> * solib.c (enable_break): Only call warning once diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h index 96b25504cb..a585f916f0 100644 --- a/gdb/config/sparc/tm-sparc.h +++ b/gdb/config/sparc/tm-sparc.h @@ -20,6 +20,12 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef __STDC__ +struct frame_info; +struct type; +struct value; +#endif + #define TARGET_BYTE_ORDER BIG_ENDIAN /* Floating point is IEEE compatible. */ @@ -256,35 +262,16 @@ extern CORE_ADDR sparc_pc_adjust PARAMS ((CORE_ADDR)); a function return value of type TYPE, and copy that, in virtual format, into VALBUF. */ -#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ - { \ - if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ - { \ - memcpy ((VALBUF), ((int *)(REGBUF))+FP0_REGNUM, TYPE_LENGTH(TYPE));\ - } \ - else \ - memcpy ((VALBUF), \ - (char *)(REGBUF) + REGISTER_RAW_SIZE (O0_REGNUM) * 8 + \ - (TYPE_LENGTH(TYPE) >= REGISTER_RAW_SIZE (O0_REGNUM) \ - ? 0 : REGISTER_RAW_SIZE (O0_REGNUM) - TYPE_LENGTH(TYPE)), \ - TYPE_LENGTH(TYPE)); \ - } +#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ + sparc_extract_return_value(TYPE, REGBUF, VALBUF) +extern void +sparc_extract_return_value PARAMS ((struct type *, char [], char *)); /* Write into appropriate registers a function return value of type TYPE, given in virtual format. */ -/* On sparc, values are returned in register %o0. */ #define STORE_RETURN_VALUE(TYPE,VALBUF) \ - { \ - if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ - /* Floating-point values are returned in the register pair */ \ - /* formed by %f0 and %f1 (doubles are, anyway). */ \ - write_register_bytes (REGISTER_BYTE (FP0_REGNUM), (VALBUF), \ - TYPE_LENGTH (TYPE)); \ - else \ - /* Other values are returned in register %o0. */ \ - write_register_bytes (REGISTER_BYTE (O0_REGNUM), (VALBUF), \ - TYPE_LENGTH (TYPE)); \ - } + sparc_store_return_value(TYPE, VALBUF) +extern void sparc_store_return_value PARAMS ((struct type *, char *)); /* Extract from an array REGBUF containing the (raw) register state the address in which a function should return its structure value, @@ -339,10 +326,6 @@ sparc_extract_struct_value_address PARAMS ((char [REGISTER_BYTES])); have been stashed (the frame is of variable size, so their location is not fixed), it's convenient to record them in the frame info. */ -#ifdef __STDC__ -struct frame_info; -#endif - #define EXTRA_FRAME_INFO \ CORE_ADDR bottom; \ int flat; \ @@ -652,10 +635,6 @@ extern int deferred_stores; /* Arguments smaller than an int must promoted to ints when synthesizing function calls. */ -#ifdef __STDC__ -struct value; -#endif - #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \ sp = sparc_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)) extern CORE_ADDR |