2005-05-13 Andrew Cagney <cagney@gnu.org>

* gdbarch.sh (pseudo_register_read, pseudo_register_write)
	(value_to_register, register_to_value, pointer_to_address)
	(address_to_pointer, return_value, extract_return_value)
	(store_return_value): Instead of a void pointer, use gdb_byte.
	* gdbarch.h, gdbarch.c: Regenerate.
	* inferior.h (unsigned_address_to_pointer)
	(signed_pointer_to_address, address_to_signed_pointer)
	(unsigned_pointer_to_address): Update.
	* arch-utils.h (legacy_return_value):
	* arch-utils.c (legacy_extract_return_value)
	(legacy_return_value): Update.
	* findvar.c (unsigned_pointer_to_address)
	(signed_pointer_to_address, unsigned_address_to_pointer)
	(address_to_signed_pointer): Update.
This commit is contained in:
Andrew Cagney 2005-05-14 06:07:42 +00:00
parent 1fe44d7986
commit b60c417a18
8 changed files with 69 additions and 51 deletions

View File

@ -1,3 +1,20 @@
2005-05-13 Andrew Cagney <cagney@gnu.org>
* gdbarch.sh (pseudo_register_read, pseudo_register_write)
(value_to_register, register_to_value, pointer_to_address)
(address_to_pointer, return_value, extract_return_value)
(store_return_value): Instead of a void pointer, use gdb_byte.
* gdbarch.h, gdbarch.c: Regenerate.
* inferior.h (unsigned_address_to_pointer)
(signed_pointer_to_address, address_to_signed_pointer)
(unsigned_pointer_to_address): Update.
* arch-utils.h (legacy_return_value):
* arch-utils.c (legacy_extract_return_value)
(legacy_return_value): Update.
* findvar.c (unsigned_pointer_to_address)
(signed_pointer_to_address, unsigned_address_to_pointer)
(address_to_signed_pointer): Update.
2005-05-13 Orjan Friberg <orjanf@axis.com>
* cris-tdep.c (_initialize_cris_tdep): Improve help strings for

View File

@ -41,7 +41,7 @@
register cache. */
void
legacy_extract_return_value (struct type *type, struct regcache *regcache,
void *valbuf)
gdb_byte *valbuf)
{
char *registers = deprecated_grub_regcache_for_registers (regcache);
gdb_byte *buf = valbuf;
@ -52,7 +52,7 @@ legacy_extract_return_value (struct type *type, struct regcache *regcache,
Takes a local copy of the buffer to avoid const problems. */
void
legacy_store_return_value (struct type *type, struct regcache *regcache,
const void *buf)
const gdb_byte *buf)
{
gdb_byte *b = alloca (TYPE_LENGTH (type));
gdb_assert (regcache == current_regcache);
@ -68,8 +68,8 @@ always_use_struct_convention (int gcc_p, struct type *value_type)
enum return_value_convention
legacy_return_value (struct gdbarch *gdbarch, struct type *valtype,
struct regcache *regcache, void *readbuf,
const void *writebuf)
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. */

View File

@ -38,8 +38,8 @@ extern int gdbarch_debug;
enum return_value_convention legacy_return_value (struct gdbarch *gdbarch,
struct type *valtype,
struct regcache *regcache,
void *readbuf,
const void *writebuf);
gdb_byte *readbuf,
const gdb_byte *writebuf);
/* Implementation of extract return value that grubs around in the
register cache. */

View File

@ -295,13 +295,13 @@ value_of_register (int regnum, struct frame_info *frame)
/* Given a pointer of type TYPE in target form in BUF, return the
address it represents. */
CORE_ADDR
unsigned_pointer_to_address (struct type *type, const void *buf)
unsigned_pointer_to_address (struct type *type, const gdb_byte *buf)
{
return extract_unsigned_integer (buf, TYPE_LENGTH (type));
}
CORE_ADDR
signed_pointer_to_address (struct type *type, const void *buf)
signed_pointer_to_address (struct type *type, const gdb_byte *buf)
{
return extract_signed_integer (buf, TYPE_LENGTH (type));
}
@ -309,13 +309,14 @@ signed_pointer_to_address (struct type *type, const void *buf)
/* Given an address, store it as a pointer of type TYPE in target
format in BUF. */
void
unsigned_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr)
unsigned_address_to_pointer (struct type *type, gdb_byte *buf,
CORE_ADDR addr)
{
store_unsigned_integer (buf, TYPE_LENGTH (type), addr);
}
void
address_to_signed_pointer (struct type *type, void *buf, CORE_ADDR addr)
address_to_signed_pointer (struct type *type, gdb_byte *buf, CORE_ADDR addr)
{
store_signed_integer (buf, TYPE_LENGTH (type), addr);
}

View File

@ -2016,7 +2016,7 @@ gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
}
void
gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf)
gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->pseudo_register_read != NULL);
@ -2040,7 +2040,7 @@ gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
}
void
gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf)
gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->pseudo_register_write != NULL);
@ -2654,7 +2654,7 @@ set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
}
void
gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, void *buf)
gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->register_to_value != NULL);
@ -2671,7 +2671,7 @@ set_gdbarch_register_to_value (struct gdbarch *gdbarch,
}
void
gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const void *buf)
gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->value_to_register != NULL);
@ -2688,7 +2688,7 @@ set_gdbarch_value_to_register (struct gdbarch *gdbarch,
}
CORE_ADDR
gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf)
gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->pointer_to_address != NULL);
@ -2705,7 +2705,7 @@ set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
}
void
gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->address_to_pointer != NULL);
@ -2777,7 +2777,7 @@ gdbarch_return_value_p (struct gdbarch *gdbarch)
}
enum return_value_convention
gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf)
gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->return_value != NULL);
@ -2795,7 +2795,7 @@ set_gdbarch_return_value (struct gdbarch *gdbarch,
}
void
gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf)
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);
@ -2812,7 +2812,7 @@ set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
}
void
gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf)
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);

View File

@ -322,14 +322,14 @@ extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_
extern int gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch);
typedef void (gdbarch_pseudo_register_read_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf);
extern void gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf);
typedef void (gdbarch_pseudo_register_read_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf);
extern void gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf);
extern void set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch, gdbarch_pseudo_register_read_ftype *pseudo_register_read);
extern int gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch);
typedef void (gdbarch_pseudo_register_write_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf);
extern void gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf);
typedef void (gdbarch_pseudo_register_write_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf);
extern void gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf);
extern void set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype *pseudo_register_write);
extern int gdbarch_num_regs (struct gdbarch *gdbarch);
@ -707,8 +707,8 @@ extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_con
#define CONVERT_REGISTER_P(regnum, type) (gdbarch_convert_register_p (current_gdbarch, regnum, type))
#endif
typedef void (gdbarch_register_to_value_ftype) (struct frame_info *frame, int regnum, struct type *type, void *buf);
extern void gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, void *buf);
typedef void (gdbarch_register_to_value_ftype) (struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf);
extern void gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf);
extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value);
#if !defined (GDB_TM_FILE) && defined (REGISTER_TO_VALUE)
#error "Non multi-arch definition of REGISTER_TO_VALUE"
@ -717,8 +717,8 @@ extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_regi
#define REGISTER_TO_VALUE(frame, regnum, type, buf) (gdbarch_register_to_value (current_gdbarch, frame, regnum, type, buf))
#endif
typedef void (gdbarch_value_to_register_ftype) (struct frame_info *frame, int regnum, struct type *type, const void *buf);
extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const void *buf);
typedef void (gdbarch_value_to_register_ftype) (struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf);
extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf);
extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register);
#if !defined (GDB_TM_FILE) && defined (VALUE_TO_REGISTER)
#error "Non multi-arch definition of VALUE_TO_REGISTER"
@ -727,8 +727,8 @@ extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_valu
#define VALUE_TO_REGISTER(frame, regnum, type, buf) (gdbarch_value_to_register (current_gdbarch, frame, regnum, type, buf))
#endif
typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, const void *buf);
extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf);
typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, const gdb_byte *buf);
extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address);
#if !defined (GDB_TM_FILE) && defined (POINTER_TO_ADDRESS)
#error "Non multi-arch definition of POINTER_TO_ADDRESS"
@ -737,8 +737,8 @@ extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_poi
#define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf))
#endif
typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, void *buf, CORE_ADDR addr);
extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr);
typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, gdb_byte *buf, CORE_ADDR addr);
extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr);
extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer);
#if !defined (GDB_TM_FILE) && defined (ADDRESS_TO_POINTER)
#error "Non multi-arch definition of ADDRESS_TO_POINTER"
@ -789,8 +789,8 @@ extern void set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch,
extern int gdbarch_return_value_p (struct gdbarch *gdbarch);
typedef enum return_value_convention (gdbarch_return_value_ftype) (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf);
extern enum return_value_convention gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf);
typedef enum return_value_convention (gdbarch_return_value_ftype) (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf);
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,
@ -798,8 +798,8 @@ extern void set_gdbarch_return_value (struct gdbarch *gdbarch, gdbarch_return_va
DEPRECATED_USE_STRUCT_CONVENTION have all been folded into
RETURN_VALUE. */
typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regcache *regcache, void *valbuf);
extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf);
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);
#if !defined (GDB_TM_FILE) && defined (EXTRACT_RETURN_VALUE)
#error "Non multi-arch definition of EXTRACT_RETURN_VALUE"
@ -808,8 +808,8 @@ extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_e
#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regcache, valbuf))
#endif
typedef void (gdbarch_store_return_value_ftype) (struct type *type, struct regcache *regcache, const void *valbuf);
extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf);
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);
#if !defined (GDB_TM_FILE) && defined (STORE_RETURN_VALUE)
#error "Non multi-arch definition of STORE_RETURN_VALUE"

View File

@ -423,8 +423,8 @@ F:TARGET_READ_SP:CORE_ADDR:read_sp:void
# serious shakedown.
f:TARGET_VIRTUAL_FRAME_POINTER:void:virtual_frame_pointer:CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset:pc, frame_regnum, frame_offset:0:legacy_virtual_frame_pointer::0
#
M::void:pseudo_register_read:struct regcache *regcache, int cookednum, void *buf:regcache, cookednum, buf
M::void:pseudo_register_write:struct regcache *regcache, int cookednum, const void *buf:regcache, cookednum, buf
M::void:pseudo_register_read:struct regcache *regcache, int cookednum, gdb_byte *buf:regcache, cookednum, buf
M::void:pseudo_register_write:struct regcache *regcache, int cookednum, const gdb_byte *buf:regcache, cookednum, buf
#
v:=:int:num_regs:::0:-1
# This macro gives the number of pseudo-registers that live in the
@ -494,11 +494,11 @@ F:=:int:get_longjmp_target:CORE_ADDR *pc:pc
v:=:int:believe_pcc_promotion:::::::
#
f:=:int:convert_register_p:int regnum, struct type *type:regnum, type:0:generic_convert_register_p::0
f:=:void:register_to_value:struct frame_info *frame, int regnum, struct type *type, void *buf:frame, regnum, type, buf:0
f:=:void:value_to_register:struct frame_info *frame, int regnum, struct type *type, const void *buf:frame, regnum, type, buf:0
f:=:void:register_to_value:struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf:frame, regnum, type, buf:0
f:=:void:value_to_register:struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf:frame, regnum, type, buf:0
#
f:=:CORE_ADDR:pointer_to_address:struct type *type, const void *buf:type, buf::unsigned_pointer_to_address::0
f:=:void:address_to_pointer:struct type *type, void *buf, CORE_ADDR addr:type, buf, addr::unsigned_address_to_pointer::0
f:=:CORE_ADDR:pointer_to_address:struct type *type, const gdb_byte *buf:type, buf::unsigned_pointer_to_address::0
f:=:void:address_to_pointer:struct type *type, gdb_byte *buf, CORE_ADDR addr:type, buf, addr::unsigned_address_to_pointer::0
M::CORE_ADDR:integer_to_address:struct type *type, const gdb_byte *buf:type, buf
#
# NOTE: cagney/2003-03-24: Replaced by PUSH_ARGUMENTS.
@ -512,15 +512,15 @@ F:=:void:deprecated_store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp
# 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, void *readbuf, const void *writebuf:valtype, regcache, readbuf, writebuf::legacy_return_value
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, void *valbuf:type, regcache, valbuf::legacy_extract_return_value::0
f:=:void:store_return_value:struct type *type, struct regcache *regcache, const void *valbuf:type, regcache, valbuf::legacy_store_return_value::0
f:=:void:extract_return_value:struct type *type, struct regcache *regcache, gdb_byte *valbuf:type, regcache, valbuf::legacy_extract_return_value::0
f:=:void:store_return_value:struct type *type, struct regcache *regcache, const gdb_byte *valbuf:type, regcache, valbuf::legacy_store_return_value::0
f:=:void:deprecated_extract_return_value:struct type *type, gdb_byte *regbuf, gdb_byte *valbuf:type, regbuf, valbuf
f:=:void:deprecated_store_return_value:struct type *type, gdb_byte *valbuf:type, valbuf
f:=:int:deprecated_use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type::generic_use_struct_convention::0

View File

@ -177,13 +177,13 @@ extern void generic_target_write_pc (CORE_ADDR, ptid_t);
extern CORE_ADDR read_sp (void);
extern CORE_ADDR unsigned_pointer_to_address (struct type *type, const void *buf);
extern void unsigned_address_to_pointer (struct type *type, void *buf,
extern CORE_ADDR unsigned_pointer_to_address (struct type *type,
const gdb_byte *buf);
extern void unsigned_address_to_pointer (struct type *type, gdb_byte *buf,
CORE_ADDR addr);
extern CORE_ADDR signed_pointer_to_address (struct type *type,
const void *buf);
extern void address_to_signed_pointer (struct type *type, void *buf,
const gdb_byte *buf);
extern void address_to_signed_pointer (struct type *type, gdb_byte *buf,
CORE_ADDR addr);
extern void wait_for_inferior (void);