From 16ac4ab5a8d7c4998e8a2648a452df6e96e5e4ef Mon Sep 17 00:00:00 2001 From: Kazuhiro Inaoka Date: Tue, 8 Nov 2005 05:54:22 +0000 Subject: [PATCH] 2005-11-08 Kei Sakamoto * m32r-linux-tdep.c (linux_sigtramp_code): Use 'gdb_byte' instead of 'unsigned char'. (m32r_linux_sigtramp_start): Likewise. (linux_rt_sigtramp_code): Likewise. (m32r_linux_rt_sigtramp_start): Likewise. (m32r_linux_sigtramp_frame_prev_register): Use 'gdb_byte *' instead of 'void *'. * m32r-tdep.c (m32r_memory_insert_breakpoint): Use 'gdb_byte' instead of 'char'. (m32r_memory_remove_breakpoint): Likewise. (m32r_breakpoint_from_pc): Likewise. (m32r_store_return_value): Likewise. (decode_prologue): Likewise. (m32r_push_dummy_call): Likewise. (m32r_return_value): Use 'gdb_byte *' instead of 'void *'. * remote-m32r-sdi.c (m32r_xfer_memory): Use 'gdb_byte' instead of 'char'. --- gdb/ChangeLog | 20 ++++++++++++++++++++ gdb/m32r-linux-tdep.c | 10 +++++----- gdb/m32r-tdep.c | 34 +++++++++++++++++----------------- gdb/remote-m32r-sdi.c | 2 +- 4 files changed, 43 insertions(+), 23 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 45a4d726e9f..27dc47fc4b4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,23 @@ +2005-11-08 Kei Sakamoto + + * m32r-linux-tdep.c (linux_sigtramp_code): Use 'gdb_byte' instead + of 'unsigned char'. + (m32r_linux_sigtramp_start): Likewise. + (linux_rt_sigtramp_code): Likewise. + (m32r_linux_rt_sigtramp_start): Likewise. + (m32r_linux_sigtramp_frame_prev_register): Use 'gdb_byte *' instead + of 'void *'. + * m32r-tdep.c (m32r_memory_insert_breakpoint): Use 'gdb_byte' + instead of 'char'. + (m32r_memory_remove_breakpoint): Likewise. + (m32r_breakpoint_from_pc): Likewise. + (m32r_store_return_value): Likewise. + (decode_prologue): Likewise. + (m32r_push_dummy_call): Likewise. + (m32r_return_value): Use 'gdb_byte *' instead of 'void *'. + * remote-m32r-sdi.c (m32r_xfer_memory): Use 'gdb_byte' instead of + 'char'. + 2005-11-07 Kevin Buettner * ia64-tdep.c (floatformat_valid): Change type of `from' from diff --git a/gdb/m32r-linux-tdep.c b/gdb/m32r-linux-tdep.c index a4f407f9942..3d4aed43704 100644 --- a/gdb/m32r-linux-tdep.c +++ b/gdb/m32r-linux-tdep.c @@ -77,7 +77,7 @@ to the ones used by the kernel. Therefore, these trampolines are supported too. */ -static const unsigned char linux_sigtramp_code[] = { +static const gdb_byte linux_sigtramp_code[] = { 0x67, 0x77, 0x10, 0xf2, }; @@ -87,7 +87,7 @@ static const unsigned char linux_sigtramp_code[] = { static CORE_ADDR m32r_linux_sigtramp_start (CORE_ADDR pc, struct frame_info *next_frame) { - unsigned char buf[4]; + gdb_byte buf[4]; /* We only recognize a signal trampoline if PC is at the start of one of the instructions. We optimize for finding the PC at the @@ -125,7 +125,7 @@ m32r_linux_sigtramp_start (CORE_ADDR pc, struct frame_info *next_frame) The effect is to call the system call rt_sigreturn. */ -static const unsigned char linux_rt_sigtramp_code[] = { +static const gdb_byte linux_rt_sigtramp_code[] = { 0x97, 0xf0, 0x00, 0xad, 0x10, 0xf2, 0xf0, 0x00, }; @@ -135,7 +135,7 @@ static const unsigned char linux_rt_sigtramp_code[] = { static CORE_ADDR m32r_linux_rt_sigtramp_start (CORE_ADDR pc, struct frame_info *next_frame) { - unsigned char buf[4]; + gdb_byte buf[4]; /* We only recognize a signal trampoline if PC is at the start of one of the instructions. We optimize for finding the PC at the @@ -282,7 +282,7 @@ m32r_linux_sigtramp_frame_prev_register (struct frame_info *next_frame, int regnum, int *optimizedp, enum lval_type *lvalp, CORE_ADDR *addrp, - int *realnump, void *valuep) + int *realnump, gdb_byte *valuep) { struct m32r_frame_cache *cache = m32r_linux_sigtramp_frame_cache (next_frame, this_cache); diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index 26deea0d5ee..b978dfeef70 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -84,8 +84,8 @@ static int m32r_memory_insert_breakpoint (CORE_ADDR addr, bfd_byte *contents_cache) { int val; - char buf[4]; - char bp_entry[] = { 0x10, 0xf1 }; /* dpt */ + gdb_byte buf[4]; + gdb_byte bp_entry[] = { 0x10, 0xf1 }; /* dpt */ /* Save the memory contents. */ val = target_read_memory (addr & 0xfffffffc, contents_cache, 4); @@ -137,7 +137,7 @@ static int m32r_memory_remove_breakpoint (CORE_ADDR addr, bfd_byte *contents_cache) { int val; - char buf[4]; + gdb_byte buf[4]; buf[0] = contents_cache[0]; buf[1] = contents_cache[1]; @@ -161,12 +161,12 @@ m32r_memory_remove_breakpoint (CORE_ADDR addr, bfd_byte *contents_cache) return val; } -static const unsigned char * +static const gdb_byte * m32r_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) { - static char be_bp_entry[] = { 0x10, 0xf1, 0x70, 0x00 }; /* dpt -> nop */ - static char le_bp_entry[] = { 0x00, 0x70, 0xf1, 0x10 }; /* dpt -> nop */ - unsigned char *bp; + static gdb_byte be_bp_entry[] = { 0x10, 0xf1, 0x70, 0x00 }; /* dpt -> nop */ + static gdb_byte le_bp_entry[] = { 0x00, 0x70, 0xf1, 0x10 }; /* dpt -> nop */ + gdb_byte *bp; /* Determine appropriate breakpoint. */ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) @@ -250,7 +250,7 @@ m32r_store_return_value (struct type *type, struct regcache *regcache, if (len > 4) { - regval = extract_unsigned_integer ((char *) valbuf + 4, len - 4); + regval = extract_unsigned_integer ((gdb_byte *) valbuf + 4, len - 4); regcache_cooked_write_unsigned (regcache, RET1_REGNUM + 1, regval); } } @@ -345,7 +345,7 @@ decode_prologue (CORE_ADDR start_pc, CORE_ADDR scan_limit, if ((insn >> 8) == 0x4f) /* addi sp, xx */ /* add 8 bit sign-extended offset */ { - int stack_adjust = (char) (insn & 0xff); + int stack_adjust = (gdb_byte) (insn & 0xff); /* there are probably two of these stack adjustments: 1) A negative one in the prologue, and @@ -574,7 +574,7 @@ m32r_frame_unwind_cache (struct frame_info *next_frame, else if ((op & 0xff00) == 0x4f00) { /* addi sp, xx */ - int n = (char) (op & 0xff); + int n = (gdb_byte) (op & 0xff); info->sp_offset += n; } else if (op == 0x1d8f) @@ -679,8 +679,8 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct type *type; enum type_code typecode; CORE_ADDR regval; - char *val; - char valbuf[MAX_REGISTER_SIZE]; + gdb_byte *val; + gdb_byte valbuf[MAX_REGISTER_SIZE]; int len; int odd_sized_struct; @@ -726,11 +726,11 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { /* value gets right-justified in the register or stack word */ memcpy (valbuf + (register_size (gdbarch, argreg) - len), - (char *) value_contents (args[argnum]), len); + (gdb_byte *) value_contents (args[argnum]), len); val = valbuf; } else - val = (char *) value_contents (args[argnum]); + val = (gdb_byte *) value_contents (args[argnum]); while (len > 0) { @@ -791,8 +791,8 @@ m32r_extract_return_value (struct type *type, struct regcache *regcache, enum return_value_convention m32r_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) { if (TYPE_LENGTH (valtype) > 8) return RETURN_VALUE_STRUCT_CONVENTION; @@ -852,7 +852,7 @@ m32r_frame_prev_register (struct frame_info *next_frame, void **this_prologue_cache, int regnum, int *optimizedp, enum lval_type *lvalp, CORE_ADDR *addrp, - int *realnump, void *bufferp) + int *realnump, gdb_byte *bufferp) { struct m32r_unwind_cache *info = m32r_frame_unwind_cache (next_frame, this_prologue_cache); diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c index 9471c115381..3019aac32fb 100644 --- a/gdb/remote-m32r-sdi.c +++ b/gdb/remote-m32r-sdi.c @@ -1032,7 +1032,7 @@ m32r_files_info (struct target_ops *target) /* Read/Write memory. */ static int -m32r_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, +m32r_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write, struct mem_attrib *attrib, struct target_ops *target) {