diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-08-26 21:49:40 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-08-26 21:49:40 +0000 |
commit | 138dd57ce055b215ebf28057a2a54fcaf1048f66 (patch) | |
tree | 8e4c28dfcc92ea3aa97ee3ab085d00c2ce191b39 | |
parent | eb03abe8da4c2997a063c270edaedf5c9327aef6 (diff) | |
download | gdb-138dd57ce055b215ebf28057a2a54fcaf1048f66.zip gdb-138dd57ce055b215ebf28057a2a54fcaf1048f66.tar.gz gdb-138dd57ce055b215ebf28057a2a54fcaf1048f66.tar.bz2 |
* config/mips/tm-mips.h (EXTRACT_STRUCT_VALUE_ADDRESS):
Get struct return address from v0, not a0.
-rw-r--r-- | gdb/config/mips/tm-mips.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h index d414e57..f2b657c 100644 --- a/gdb/config/mips/tm-mips.h +++ b/gdb/config/mips/tm-mips.h @@ -115,6 +115,7 @@ extern CORE_ADDR mips_skip_prologue PARAMS ((CORE_ADDR addr, int lenient)); but do serve to get the desired values when passed to read_register. */ #define ZERO_REGNUM 0 /* read-only register, always 0 */ +#define V0_REGNUM 2 /* Function integer return value */ #define A0_REGNUM 4 /* Loc of first arg during a subr call */ #define SP_REGNUM 29 /* Contains address of top of stack */ #define RA_REGNUM 31 /* Contains return address value */ @@ -232,8 +233,13 @@ extern CORE_ADDR mips_skip_prologue PARAMS ((CORE_ADDR addr, int lenient)); /* Extract from an array REGBUF containing the (raw) register state the address in which a function should return its structure value, as a CORE_ADDR (or an expression that can be used as one). */ +/* The address is passed in a0 upon entry to the function, but when + the function exits, the compiler has copied the value to v0. This + seems to be a convention followed by both cc and gcc. */ -#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF+16)) +#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ + (extract_address (REGBUF + REGISTER_BYTE (V0_REGNUM), \ + REGISTER_RAW_SIZE (V0_REGNUM))) /* Structures are returned by ref in extra arg0 */ #define USE_STRUCT_CONVENTION(gcc_p, type) 1 |