* vax-tdep.c (vax_store_struct_return): New function.
(vax_extract_return_value): Ditto. (vax_store_return_value): Ditto. (vax_extract_struct_value_address): Ditto. * config/vax/tm-vax.h (STORE_STRUCT_RETURN): Use vax_store_struct_return. (EXTRACT_RETURN_VALUE): Use vax_extract_return_value. (STORE_RETURN_VALUE): Use vax_store_return_value. (EXTRACT_STRUCT_VALUE_ADDRESS): Use vax_extract_struct_value_address.
This commit is contained in:
parent
5516aa921e
commit
ea74468cd0
|
@ -1,3 +1,15 @@
|
|||
2002-04-22 Jason Thorpe <thorpej@wasabisystems.com>
|
||||
|
||||
* vax-tdep.c (vax_store_struct_return): New function.
|
||||
(vax_extract_return_value): Ditto.
|
||||
(vax_store_return_value): Ditto.
|
||||
(vax_extract_struct_value_address): Ditto.
|
||||
* config/vax/tm-vax.h (STORE_STRUCT_RETURN): Use
|
||||
vax_store_struct_return.
|
||||
(EXTRACT_RETURN_VALUE): Use vax_extract_return_value.
|
||||
(STORE_RETURN_VALUE): Use vax_store_return_value.
|
||||
(EXTRACT_STRUCT_VALUE_ADDRESS): Use vax_extract_struct_value_address.
|
||||
|
||||
2002-04-22 Jason Thorpe <thorpej@wasabisystems.com>
|
||||
|
||||
* vax-tdep.c (vax_frame_saved_pc): New function.
|
||||
|
|
|
@ -122,30 +122,20 @@ extern int vax_register_virtual_size (int);
|
|||
#define REGISTER_VIRTUAL_TYPE(N) vax_register_virtual_type ((N))
|
||||
extern struct type *vax_register_virtual_type (int);
|
||||
|
||||
/* Store the address of the place in which to copy the structure the
|
||||
subroutine will return. This is called from call_function. */
|
||||
|
||||
#define STORE_STRUCT_RETURN(ADDR, SP) \
|
||||
{ write_register (1, (ADDR)); }
|
||||
|
||||
/* Extract from an array REGBUF containing the (raw) register state
|
||||
a function return value of type TYPE, and copy that, in virtual format,
|
||||
into VALBUF. */
|
||||
#define STORE_STRUCT_RETURN(ADDR, SP) vax_store_struct_return ((ADDR), (SP))
|
||||
extern void vax_store_struct_return (CORE_ADDR, CORE_ADDR);
|
||||
|
||||
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
|
||||
memcpy (VALBUF, REGBUF, TYPE_LENGTH (TYPE))
|
||||
|
||||
/* Write into appropriate registers a function return value
|
||||
of type TYPE, given in virtual format. */
|
||||
vax_extract_return_value ((TYPE), (REGBUF), (VALBUF))
|
||||
extern void vax_extract_return_value (struct type *, char *, char *);
|
||||
|
||||
#define STORE_RETURN_VALUE(TYPE,VALBUF) \
|
||||
write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
|
||||
vax_store_return_value ((TYPE), (VALBUF))
|
||||
extern void vax_store_return_value (struct type *, char *);
|
||||
|
||||
/* 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). */
|
||||
|
||||
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
|
||||
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
|
||||
vax_extract_struct_value_address ((REGBUF))
|
||||
extern CORE_ADDR vax_extract_struct_value_address (char *);
|
||||
|
||||
|
||||
/* Describe the pointer in each stack frame to the previous stack frame
|
||||
|
|
|
@ -178,6 +178,30 @@ vax_frame_num_args (struct frame_info *fi)
|
|||
return (0xff & read_memory_integer (FRAME_ARGS_ADDRESS (fi), 1));
|
||||
}
|
||||
|
||||
void
|
||||
vax_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
|
||||
{
|
||||
write_register (1, addr);
|
||||
}
|
||||
|
||||
void
|
||||
vax_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
|
||||
{
|
||||
memcpy (valbuf, regbuf + REGISTER_BYTE (0), TYPE_LENGTH (valtype));
|
||||
}
|
||||
|
||||
void
|
||||
vax_store_return_value (struct type *valtype, char *valbuf)
|
||||
{
|
||||
write_register_bytes (0, valbuf, TYPE_LENGTH (valtype));
|
||||
}
|
||||
|
||||
CORE_ADDR
|
||||
vax_extract_struct_value_address (char *regbuf)
|
||||
{
|
||||
return (extract_address (regbuf + REGISTER_BYTE (0), REGISTER_RAW_SIZE (0)));
|
||||
}
|
||||
|
||||
/* Advance PC across any function entry prologue instructions
|
||||
to reach some "real" code. */
|
||||
|
||||
|
|
Loading…
Reference in New Issue