This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[COMMIT] Use gdb_byte in amd64-tdep.c and amd64obsd-tdep.c
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 8 May 2005 20:00:57 +0200 (CEST)
- Subject: [COMMIT] Use gdb_byte in amd64-tdep.c and amd64obsd-tdep.c
Don't know what happened to my previous mail. Anyway, here's a second
step.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* amd64-tdep.c (amd64_return_value): Use `gdb_byte *' in casts.
(amd64_push_arguments): Use gdb_byte instead of bfd_byte. Use
gdb_byte for buf.
(amd64_push_dummy_call): Use gdb_byte for buf.
(amd64_analyze_prologue): Use gdb_byte for proto, buf and op.
(amd64_frame_cache, amd64_sigtramp_frame_cache)
(amd64_unwind_dummy_id): Use gdb_byte for buf.
(amd64_supply_fxsave, amd64_collect_fxsave): Use `gdb_byte *' for
regs.
* amd64obsd-tdep.c (amd64obsd_supply_regset): Use `gdb_byte *' in
casts.
(amd64obsd_sigtramp_p): Use gdb_byte for sigreturn and `gdb_byte
*' for buf,
Index: amd64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-tdep.c,v
retrieving revision 1.22
diff -u -p -r1.22 amd64-tdep.c
--- amd64-tdep.c 17 Mar 2005 17:44:14 -0000 1.22
+++ amd64-tdep.c 8 May 2005 17:39:39 -0000
@@ -503,10 +503,10 @@ amd64_return_value (struct gdbarch *gdba
if (readbuf)
regcache_raw_read_part (regcache, regnum, offset, min (len, 8),
- (char *) readbuf + i * 8);
+ (gdb_byte *)readbuf + i * 8);
if (writebuf)
regcache_raw_write_part (regcache, regnum, offset, min (len, 8),
- (const char *) writebuf + i * 8);
+ (const gdb_byte *)writebuf + i * 8);
}
return RETURN_VALUE_REGISTER_CONVENTION;
@@ -581,8 +581,8 @@ amd64_push_arguments (struct regcache *r
else
{
/* The argument will be passed in registers. */
- const bfd_byte *valbuf = value_contents (args[i]);
- char buf[8];
+ const gdb_byte *valbuf = value_contents (args[i]);
+ gdb_byte buf[8];
gdb_assert (len <= 16);
@@ -630,7 +630,7 @@ amd64_push_arguments (struct regcache *r
for (i = 0; i < num_stack_args; i++)
{
struct type *type = value_type (stack_args[i]);
- const bfd_byte *valbuf = value_contents (stack_args[i]);
+ const gdb_byte *valbuf = value_contents (stack_args[i]);
int len = TYPE_LENGTH (type);
write_memory (sp + element * 8, valbuf, len);
@@ -651,7 +651,7 @@ amd64_push_dummy_call (struct gdbarch *g
int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
- char buf[8];
+ gdb_byte buf[8];
/* Pass arguments. */
sp = amd64_push_arguments (regcache, nargs, args, sp, struct_return);
@@ -740,9 +740,9 @@ static CORE_ADDR
amd64_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
struct amd64_frame_cache *cache)
{
- static unsigned char proto[3] = { 0x48, 0x89, 0xe5 };
- unsigned char buf[3];
- unsigned char op;
+ static gdb_byte proto[3] = { 0x48, 0x89, 0xe5 }; /* movq %rsp, %rbp */
+ gdb_byte buf[3];
+ gdb_byte op;
if (current_pc <= pc)
return current_pc;
@@ -795,7 +795,7 @@ static struct amd64_frame_cache *
amd64_frame_cache (struct frame_info *next_frame, void **this_cache)
{
struct amd64_frame_cache *cache;
- char buf[8];
+ gdb_byte buf[8];
int i;
if (*this_cache)
@@ -932,7 +932,7 @@ amd64_sigtramp_frame_cache (struct frame
struct amd64_frame_cache *cache;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
CORE_ADDR addr;
- char buf[8];
+ gdb_byte buf[8];
int i;
if (*this_cache)
@@ -1034,7 +1034,7 @@ static const struct frame_base amd64_fra
static struct frame_id
amd64_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
- char buf[8];
+ gdb_byte buf[8];
CORE_ADDR fp;
frame_unwind_register (next_frame, AMD64_RBP_REGNUM, buf);
@@ -1202,7 +1202,7 @@ amd64_supply_fxsave (struct regcache *re
if (fxsave && gdbarch_ptr_bit (get_regcache_arch (regcache)) == 64)
{
- const char *regs = fxsave;
+ const gdb_byte *regs = fxsave;
if (regnum == -1 || regnum == I387_FISEG_REGNUM)
regcache_raw_supply (regcache, I387_FISEG_REGNUM, regs + 12);
@@ -1220,7 +1220,7 @@ void
amd64_collect_fxsave (const struct regcache *regcache, int regnum,
void *fxsave)
{
- char *regs = fxsave;
+ gdb_byte *regs = fxsave;
i387_collect_fxsave (regcache, regnum, fxsave);
Index: amd64obsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64obsd-tdep.c,v
retrieving revision 1.15
diff -u -p -r1.15 amd64obsd-tdep.c
--- amd64obsd-tdep.c 22 Aug 2004 20:34:55 -0000 1.15
+++ amd64obsd-tdep.c 8 May 2005 17:39:39 -0000
@@ -1,6 +1,6 @@
/* Target-dependent code for OpenBSD/amd64.
- Copyright 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GDB.
@@ -47,7 +47,8 @@ amd64obsd_supply_regset (const struct re
gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FXSAVE);
i386_supply_gregset (regset, regcache, regnum, regs, tdep->sizeof_gregset);
- amd64_supply_fxsave (regcache, regnum, (char *)regs + tdep->sizeof_gregset);
+ amd64_supply_fxsave (regcache, regnum,
+ ((const gdb_byte *)regs) + tdep->sizeof_gregset);
}
static const struct regset *
@@ -84,14 +85,15 @@ amd64obsd_sigtramp_p (struct frame_info
{
CORE_ADDR pc = frame_pc_unwind (next_frame);
CORE_ADDR start_pc = (pc & ~(amd64obsd_page_size - 1));
- const char sigreturn[] =
+ const gdb_byte sigreturn[] =
{
0x48, 0xc7, 0xc0,
0x67, 0x00, 0x00, 0x00, /* movq $SYS_sigreturn, %rax */
0xcd, 0x80 /* int $0x80 */
};
size_t buflen = (sizeof sigreturn) + 1;
- char *name, *buf;
+ gdb_byte *buf;
+ char *name;
/* If the function has a valid symbol name, it isn't a
trampoline. */