From bcc5241c43307d18ef4cb61b4f98eb624d31367d Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Wed, 1 Dec 2004 06:40:35 +0000 Subject: Change gdb_cpu_setreg() to not take the value to which to set the specified register, but a pointer to the in-memory representation of that value. The reason for this is twofold: 1. Not all registers can be represented by a register_t. In particular FP registers fall in that category. Passing the new register value by reference instead of by value makes this point moot. 2. When we receive a G or P packet, both are for writing a register, the packet will have the register value in target-byte order and in the memory representation (modulo the fact that bytes are sent as 2 printable hexadecimal numbers of course). We only need to decode the packet to have a pointer to the register value. This change fixes the bug of extracting the register value of the P packet as a hexadecimal number instead of as a bit array. The quick (and dirty) fix to bswap the register value in gdb_cpu_setreg() as it has been added on i386 and amd64 can therefore be removed and has in fact been that. Tested on: alpha, amd64, i386, ia64, sparc64 --- sys/ia64/ia64/gdb_machdep.c | 2 +- sys/ia64/include/gdb_machdep.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/ia64') diff --git a/sys/ia64/ia64/gdb_machdep.c b/sys/ia64/ia64/gdb_machdep.c index 62b475577832..7729d71fbae4 100644 --- a/sys/ia64/ia64/gdb_machdep.c +++ b/sys/ia64/ia64/gdb_machdep.c @@ -128,7 +128,7 @@ gdb_cpu_getreg(int regnum, size_t *regsz) } void -gdb_cpu_setreg(int regnum, register_t val) +gdb_cpu_setreg(int regnum, void *val) { switch (regnum) { diff --git a/sys/ia64/include/gdb_machdep.h b/sys/ia64/include/gdb_machdep.h index 1b957fb8560d..b6294d7ab00e 100644 --- a/sys/ia64/include/gdb_machdep.h +++ b/sys/ia64/include/gdb_machdep.h @@ -41,7 +41,7 @@ gdb_cpu_regsz(int regnum) } void *gdb_cpu_getreg(int, size_t *); -void gdb_cpu_setreg(int, register_t); +void gdb_cpu_setreg(int, void *); int gdb_cpu_signal(int, int); int gdb_cpu_query(void); -- cgit v1.3