This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Convert arch void* to gdb_byte
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 14 May 2005 01:05:42 -0400
- Subject: [commit] Convert arch void* to gdb_byte
(assuming I've not done a bfd_byte tipo somewhere :-)
This updates the gdbarch methods that take a void* so that they instead
take a more exacting gdb_byte. It will likely trigger a warning or two
in *-tdep.c code but shouldn't trigger any warning in the core code.
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.
Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.130
diff -p -u -r1.130 arch-utils.c
--- arch-utils.c 9 May 2005 21:20:30 -0000 1.130
+++ arch-utils.c 14 May 2005 05:38:23 -0000
@@ -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
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,
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. */
Index: arch-utils.h
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.h,v
retrieving revision 1.77
diff -p -u -r1.77 arch-utils.h
--- arch-utils.h 23 Nov 2004 21:05:18 -0000 1.77
+++ arch-utils.h 14 May 2005 05:38:23 -0000
@@ -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. */
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.90
diff -p -u -r1.90 findvar.c
--- findvar.c 7 Mar 2005 22:38:04 -0000 1.90
+++ findvar.c 14 May 2005 05:38:29 -0000
@@ -295,13 +295,13 @@ value_of_register (int regnum, struct fr
/* 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 *
/* 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);
}
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.360
diff -p -u -r1.360 gdbarch.sh
--- gdbarch.sh 9 May 2005 21:20:33 -0000 1.360
+++ gdbarch.sh 14 May 2005 05:39:10 -0000
@@ -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
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:
# 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
Index: inferior.h
===================================================================
RCS file: /cvs/src/src/gdb/inferior.h,v
retrieving revision 1.70
diff -p -u -r1.70 inferior.h
--- inferior.h 8 Mar 2005 22:17:34 -0000 1.70
+++ inferior.h 14 May 2005 05:39:13 -0000
@@ -177,13 +177,13 @@ extern void generic_target_write_pc (COR
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);