diff -uprN src0/gdb/sh-tdep.c src1/gdb/sh-tdep.c --- src0/gdb/sh-tdep.c 2009-07-31 14:43:26.000000000 -0400 +++ src1/gdb/sh-tdep.c 2009-08-06 11:32:33.000000000 -0400 @@ -1031,8 +1031,6 @@ sh_next_flt_argreg (struct gdbarch *gdba static int sh_treat_as_flt_p (struct type *type) { - int len = TYPE_LENGTH (type); - /* Ordinary float types are obviously treated as float. */ if (TYPE_CODE (type) == TYPE_CODE_FLT) return 1; @@ -1128,14 +1126,15 @@ sh_push_dummy_call_fpu (struct gdbarch * { /* The data goes entirely on the stack, 4-byte aligned. */ reg_size = (len + 3) & ~3; - write_memory (sp + stack_offset, val, reg_size); + write_memory (sp + stack_offset, (gdb_byte *)val, reg_size); stack_offset += reg_size; } else if (treat_as_flt && flt_argreg <= FLOAT_ARGLAST_REGNUM) { /* Argument goes in a float argument register. */ reg_size = register_size (gdbarch, flt_argreg); - regval = extract_unsigned_integer (val, reg_size, byte_order); + regval = extract_unsigned_integer ((gdb_byte *)val, reg_size, + byte_order); /* In little endian mode, float types taking two registers (doubles on sh4, long doubles on sh2e, sh3e and sh4) must be stored swapped in the argument registers. The below @@ -1150,7 +1149,8 @@ sh_push_dummy_call_fpu (struct gdbarch * regval); val += reg_size; len -= reg_size; - regval = extract_unsigned_integer (val, reg_size, byte_order); + regval = extract_unsigned_integer ((gdb_byte *)val, reg_size, + byte_order); } regcache_cooked_write_unsigned (regcache, flt_argreg++, regval); } @@ -1158,7 +1158,8 @@ sh_push_dummy_call_fpu (struct gdbarch * { /* there's room in a register */ reg_size = register_size (gdbarch, argreg); - regval = extract_unsigned_integer (val, reg_size, byte_order); + regval = extract_unsigned_integer ((gdb_byte *)val, reg_size, + byte_order); regcache_cooked_write_unsigned (regcache, argreg++, regval); } /* Store the value one register at a time or in one step on stack. */ @@ -1252,14 +1253,15 @@ sh_push_dummy_call_nofpu (struct gdbarch /* The remainder of the data goes entirely on the stack, 4-byte aligned. */ reg_size = (len + 3) & ~3; - write_memory (sp + stack_offset, val, reg_size); + write_memory (sp + stack_offset, (gdb_byte *)val, reg_size); stack_offset += reg_size; } else if (argreg <= ARGLAST_REGNUM) { /* there's room in a register */ reg_size = register_size (gdbarch, argreg); - regval = extract_unsigned_integer (val, reg_size, byte_order); + regval = extract_unsigned_integer ((gdb_byte *)val, reg_size, + byte_order); regcache_cooked_write_unsigned (regcache, argreg++, regval); } /* Store the value reg_size bytes at a time. This means that things @@ -1304,8 +1306,6 @@ sh_extract_return_value_nofpu (struct ty struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int len = TYPE_LENGTH (type); - int return_register = R0_REGNUM; - int offset; if (len <= 4) { @@ -1318,7 +1318,7 @@ sh_extract_return_value_nofpu (struct ty { int i, regnum = R0_REGNUM; for (i = 0; i < len; i += 4) - regcache_raw_read (regcache, regnum++, (char *) valbuf + i); + regcache_raw_read (regcache, regnum++, (gdb_byte *) valbuf + i); } else error (_("bad size for return value")); @@ -1335,9 +1335,10 @@ sh_extract_return_value_fpu (struct type int i, regnum = gdbarch_fp0_regnum (gdbarch); for (i = 0; i < len; i += 4) if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE) - regcache_raw_read (regcache, regnum++, (char *) valbuf + len - 4 - i); + regcache_raw_read (regcache, regnum++, (gdb_byte *) valbuf + len - 4 + - i); else - regcache_raw_read (regcache, regnum++, (char *) valbuf + i); + regcache_raw_read (regcache, regnum++, (gdb_byte *) valbuf + i); } else sh_extract_return_value_nofpu (type, regcache, valbuf); @@ -1367,7 +1368,7 @@ sh_store_return_value_nofpu (struct type { int i, regnum = R0_REGNUM; for (i = 0; i < len; i += 4) - regcache_raw_write (regcache, regnum++, (char *) valbuf + i); + regcache_raw_write (regcache, regnum++, (gdb_byte *) valbuf + i); } } @@ -1383,9 +1384,9 @@ sh_store_return_value_fpu (struct type * for (i = 0; i < len; i += 4) if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE) regcache_raw_write (regcache, regnum++, - (char *) valbuf + len - 4 - i); + (gdb_byte *) valbuf + len - 4 - i); else - regcache_raw_write (regcache, regnum++, (char *) valbuf + i); + regcache_raw_write (regcache, regnum++, (gdb_byte *) valbuf + i); } else sh_store_return_value_nofpu (type, regcache, valbuf); @@ -1709,8 +1710,6 @@ sh2a_show_regs (struct frame_info *frame static void sh2a_nofpu_show_regs (struct frame_info *frame) { - int pr = get_frame_register_unsigned (frame, FPSCR_REGNUM) & 0x80000; - printf_filtered (" PC %s SR %08lx PR %08lx MACH %08lx\n", phex (get_frame_register_unsigned (frame, @@ -2304,7 +2303,7 @@ sh_pseudo_register_read (struct gdbarch int reg_nr, gdb_byte *buffer) { int base_regnum, portion; - char temp_buffer[MAX_REGISTER_SIZE]; + gdb_byte temp_buffer[MAX_REGISTER_SIZE]; if (reg_nr == PSEUDO_BANK_REGNUM) regcache_raw_read (regcache, BANK_REGNUM, buffer); @@ -2323,7 +2322,7 @@ sh_pseudo_register_read (struct gdbarch /* We must pay attention to the endiannes. */ sh_register_convert_to_virtual (reg_nr, register_type (gdbarch, reg_nr), - temp_buffer, buffer); + (char *)temp_buffer, (char *)buffer); } else if (reg_nr >= FV0_REGNUM && reg_nr <= FV_LAST_REGNUM) { @@ -2332,7 +2331,7 @@ sh_pseudo_register_read (struct gdbarch /* Read the real regs for which this one is an alias. */ for (portion = 0; portion < 4; portion++) regcache_raw_read (regcache, base_regnum + portion, - ((char *) buffer + (gdb_byte *)((char *) buffer + register_size (gdbarch, base_regnum) * portion)); } @@ -2368,7 +2367,7 @@ sh_pseudo_register_write (struct gdbarch /* Write the real regs for which this one is an alias. */ for (portion = 0; portion < 2; portion++) regcache_raw_write (regcache, base_regnum + portion, - (temp_buffer + (gdb_byte *)(temp_buffer + register_size (gdbarch, base_regnum) * portion)); } @@ -2379,7 +2378,7 @@ sh_pseudo_register_write (struct gdbarch /* Write the real regs for which this one is an alias. */ for (portion = 0; portion < 4; portion++) regcache_raw_write (regcache, base_regnum + portion, - ((char *) buffer + (gdb_byte *)((char *) buffer + register_size (gdbarch, base_regnum) * portion)); } @@ -2970,8 +2969,6 @@ extern initialize_file_ftype _initialize void _initialize_sh_tdep (void) { - struct cmd_list_element *c; - gdbarch_register (bfd_arch_sh, sh_gdbarch_init, NULL); add_com ("regs", class_vars, sh_show_regs_command, _("Print all registers")); diff -uprN src0/gdb/sh64-tdep.c src1/gdb/sh64-tdep.c --- src0/gdb/sh64-tdep.c 2009-07-06 09:28:21.000000000 -0400 +++ src1/gdb/sh64-tdep.c 2009-08-06 13:15:54.000000000 -0400 @@ -846,15 +846,11 @@ sh64_analyze_prologue (struct gdbarch *g CORE_ADDR func_pc, CORE_ADDR current_pc) { - int reg_nr; int pc; int opc; int insn; int r0_val = 0; int insn_size; - int gdb_register_number; - int register_number; - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); cache->sp_offset = 0; @@ -1051,9 +1047,8 @@ sh64_push_dummy_call (struct gdbarch *gd int argnum; struct type *type; CORE_ADDR regval; - char *val; - char valbuf[8]; - char valbuf_tmp[8]; + const gdb_byte *val; + gdb_byte valbuf[8]; int len; int argreg_size; int fp_args[12]; @@ -1105,7 +1100,7 @@ sh64_push_dummy_call (struct gdbarch *gd val = valbuf; } else - val = (char *) value_contents (args[argnum]); + val = value_contents (args[argnum]); while (len > 0) { @@ -1137,7 +1132,7 @@ sh64_push_dummy_call (struct gdbarch *gd } else { - val = (char *) value_contents (args[argnum]); + val = value_contents (args[argnum]); if (len == 4) { /* Where is it going to be stored? */ @@ -1211,7 +1206,6 @@ sh64_extract_return_value (struct type * void *valbuf) { struct gdbarch *gdbarch = get_regcache_arch (regcache); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int len = TYPE_LENGTH (type); if (TYPE_CODE (type) == TYPE_CODE_FLT) @@ -1244,7 +1238,7 @@ sh64_extract_return_value (struct type * if (len <= 8) { int offset; - char buf[8]; + gdb_byte buf[8]; /* Result is in register 2. If smaller than 8 bytes, it is padded at the most significant end. */ regcache_raw_read (regcache, DEFAULT_RETURN_REGNUM, buf); @@ -1273,7 +1267,7 @@ sh64_store_return_value (struct type *ty const void *valbuf) { struct gdbarch *gdbarch = get_regcache_arch (regcache); - char buf[64]; /* more than enough... */ + gdb_byte buf[64]; /* more than enough... */ int len = TYPE_LENGTH (type); if (TYPE_CODE (type) == TYPE_CODE_FLT) @@ -1282,9 +1276,9 @@ sh64_store_return_value (struct type *ty for (i = 0; i < len; i += 4) if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE) regcache_raw_write (regcache, regnum++, - (char *) valbuf + len - 4 - i); + valbuf + len - 4 - i); else - regcache_raw_write (regcache, regnum++, (char *) valbuf + i); + regcache_raw_write (regcache, regnum++, (gdb_byte *) valbuf + i); } else { @@ -1551,7 +1545,8 @@ sh64_register_type (struct gdbarch *gdba static void sh64_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, - struct type *type, char *from, char *to) + struct type *type, gdb_byte *from, + gdb_byte *to) { if (gdbarch_byte_order (gdbarch) != BFD_ENDIAN_LITTLE) { @@ -1606,7 +1601,7 @@ sh64_pseudo_register_read (struct gdbarc int base_regnum; int portion; int offset = 0; - char temp_buffer[MAX_REGISTER_SIZE]; + gdb_byte temp_buffer[MAX_REGISTER_SIZE]; if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM) @@ -1638,7 +1633,7 @@ sh64_pseudo_register_read (struct gdbarc concatenating 2 single precision floating point registers. */ for (portion = 0; portion < 2; portion++) regcache_raw_read (regcache, base_regnum + portion, - ((char *) buffer + (buffer + register_size (gdbarch, base_regnum) * portion)); } @@ -1652,7 +1647,7 @@ sh64_pseudo_register_read (struct gdbarc concatenating 4 single precision floating point registers. */ for (portion = 0; portion < 4; portion++) regcache_raw_read (regcache, base_regnum + portion, - ((char *) buffer + (buffer + register_size (gdbarch, base_regnum) * portion)); } @@ -1708,7 +1703,7 @@ sh64_pseudo_register_read (struct gdbarc concatenating 4 single precision floating point registers. */ for (portion = 0; portion < 4; portion++) regcache_raw_read (regcache, base_regnum + portion, - ((char *) buffer + (buffer + register_size (gdbarch, base_regnum) * portion)); } @@ -1773,7 +1768,7 @@ sh64_pseudo_register_write (struct gdbar enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int base_regnum, portion; int offset; - char temp_buffer[MAX_REGISTER_SIZE]; + gdb_byte temp_buffer[MAX_REGISTER_SIZE]; if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM) @@ -1800,7 +1795,7 @@ sh64_pseudo_register_write (struct gdbar /* Write the real regs for which this one is an alias. */ for (portion = 0; portion < 2; portion++) regcache_raw_write (regcache, base_regnum + portion, - ((char *) buffer + (buffer + register_size (gdbarch, base_regnum) * portion)); } @@ -1813,7 +1808,7 @@ sh64_pseudo_register_write (struct gdbar /* Write the real regs for which this one is an alias. */ for (portion = 0; portion < 4; portion++) regcache_raw_write (regcache, base_regnum + portion, - ((char *) buffer + (buffer + register_size (gdbarch, base_regnum) * portion)); } @@ -1874,7 +1869,7 @@ sh64_pseudo_register_write (struct gdbar for (portion = 0; portion < 4; portion++) { regcache_raw_write (regcache, base_regnum + portion, - ((char *) buffer + (buffer + register_size (gdbarch, base_regnum) * portion)); }