This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Fix gdb_byte fallout on hppa/hppa64
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 12 Jun 2005 21:59:01 +0200 (CEST)
- Subject: [commit] Fix gdb_byte fallout on hppa/hppa64
Committed as obvious. Doesn't completely fix -Werror, but the
remaining bit isn't quite so obvious so I'll address that in a
seperate patch.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* hppa-tdep.c (hppa_frame_prev_register)
(hppa_fallback_frame_prev_register)
(hppa_stub_frame_prev_register): Change type of last argument to
`gdb_byte *'.
(hppa_fetch_pointer_argument): Tweak comment. Use
get_frame_register_unsigned instead of get_frame_register.
(hppa32_return_value, hppa64_return_value): Change type of readbuf
and writebuf arguments to `gdb_byte *'. Remove unecessary casts
and local variables.
(hppa_pseudo_register_read): Change type of last argument to
`gdb_byte *'.
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.206
diff -u -p -r1.206 hppa-tdep.c
--- hppa-tdep.c 17 Feb 2005 13:49:53 -0000 1.206
+++ hppa-tdep.c 12 Jun 2005 19:53:43 -0000
@@ -1035,7 +1035,7 @@ hppa64_push_dummy_call (struct gdbarch *
static enum return_value_convention
hppa32_return_value (struct gdbarch *gdbarch,
struct type *type, struct regcache *regcache,
- void *readbuf, const void *writebuf)
+ gdb_byte *readbuf, const gdb_byte *writebuf)
{
if (TYPE_LENGTH (type) <= 2 * 4)
{
@@ -1061,9 +1061,9 @@ hppa32_return_value (struct gdbarch *gdb
for (b = part; b < TYPE_LENGTH (type); b += 4)
{
if (readbuf != NULL)
- regcache_cooked_read (regcache, reg, (char *) readbuf + b);
+ regcache_cooked_read (regcache, reg, readbuf + b);
if (writebuf != NULL)
- regcache_cooked_write (regcache, reg, (const char *) writebuf + b);
+ regcache_cooked_write (regcache, reg, writebuf + b);
reg++;
}
return RETURN_VALUE_REGISTER_CONVENTION;
@@ -1075,7 +1075,7 @@ hppa32_return_value (struct gdbarch *gdb
static enum return_value_convention
hppa64_return_value (struct gdbarch *gdbarch,
struct type *type, struct regcache *regcache,
- void *readbuf, const void *writebuf)
+ gdb_byte *readbuf, const gdb_byte *writebuf)
{
int len = TYPE_LENGTH (type);
int regnum, offset;
@@ -1139,12 +1139,11 @@ hppa64_return_value (struct gdbarch *gdb
if (readbuf)
{
- char *buf = readbuf;
while (len > 0)
{
regcache_cooked_read_part (regcache, regnum, offset,
- min (len, 8), buf);
- buf += min (len, 8);
+ min (len, 8), readbuf);
+ readbuf += min (len, 8);
len -= min (len, 8);
regnum++;
}
@@ -1152,12 +1151,11 @@ hppa64_return_value (struct gdbarch *gdb
if (writebuf)
{
- const char *buf = writebuf;
while (len > 0)
{
regcache_cooked_write_part (regcache, regnum, offset,
- min (len, 8), buf);
- buf += min (len, 8);
+ min (len, 8), writebuf);
+ writebuf += min (len, 8);
len -= min (len, 8);
regnum++;
}
@@ -2109,7 +2107,7 @@ hppa_frame_prev_register (struct frame_i
void **this_cache,
int regnum, int *optimizedp,
enum lval_type *lvalp, CORE_ADDR *addrp,
- int *realnump, void *valuep)
+ int *realnump, gdb_byte *valuep)
{
struct hppa_frame_cache *info = hppa_frame_cache (next_frame, this_cache);
hppa_frame_prev_register_helper (next_frame, info->saved_regs, regnum,
@@ -2232,7 +2230,7 @@ hppa_fallback_frame_prev_register (struc
void **this_cache,
int regnum, int *optimizedp,
enum lval_type *lvalp, CORE_ADDR *addrp,
- int *realnump, void *valuep)
+ int *realnump, gdb_byte *valuep)
{
struct hppa_frame_cache *info =
hppa_fallback_frame_cache (next_frame, this_cache);
@@ -2317,7 +2315,7 @@ hppa_stub_frame_prev_register (struct fr
void **this_prologue_cache,
int regnum, int *optimizedp,
enum lval_type *lvalp, CORE_ADDR *addrp,
- int *realnump, void *valuep)
+ int *realnump, gdb_byte *valuep)
{
struct hppa_stub_unwind_cache *info
= hppa_stub_frame_unwind_cache (next_frame, this_prologue_cache);
@@ -2587,26 +2585,25 @@ hppa_smash_text_address (CORE_ADDR addr)
return (addr &= ~0x3);
}
-/* Get the ith function argument for the current function. */
+/* Get the ARGIth function argument for the current function. */
+
static CORE_ADDR
hppa_fetch_pointer_argument (struct frame_info *frame, int argi,
struct type *type)
{
- CORE_ADDR addr;
- get_frame_register (frame, HPPA_R0_REGNUM + 26 - argi, &addr);
- return addr;
+ return get_frame_register_unsigned (frame, HPPA_R0_REGNUM + 26 - argi);
}
static void
hppa_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
- int regnum, void *buf)
+ int regnum, gdb_byte *buf)
{
ULONGEST tmp;
regcache_raw_read_unsigned (regcache, regnum, &tmp);
if (regnum == HPPA_PCOQ_HEAD_REGNUM || regnum == HPPA_PCOQ_TAIL_REGNUM)
tmp &= ~0x3;
- store_unsigned_integer (buf, sizeof(tmp), tmp);
+ store_unsigned_integer (buf, sizeof tmp, tmp);
}
static CORE_ADDR