Use gdb_byte for bytes from the program being debugged.

gdb_byte should be used for bytes from the program being debugged.  We
have many places using char or unsigned char instead all over the
existing ports, and more ends up added over time due to copy/paste as
new code is based on old code.

I've greped the tree for "char buf[", and fixed all I found.

Tested by building with --enable-targets=all.

2013-03-01  Pedro Alves  <palves@redhat.com>

	Use gdb_byte for bytes from the program being debugged.

	* arm-tdep.c (arm_store_return_value, arm_get_longjmp_target):
	Change type of local 'buf' to gdb_byte.
	* avr-tdep.c (avr_frame_prev_register, avr_push_dummy_call): Likewise.
	* bfin-tdep.c (bfin_push_dummy_call): Likewise.
	* cris-tdep.c (cris_sigcontext_addr)
	(cris_sigtramp_frame_unwind_cache): Likewise.
	* frv-linux-tdep.c (frv_linux_pc_in_sigtramp)
	(frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache):
	Likewise.
	* frv-tdep.c (frv_pseudo_register_write, frv_analyze_prologue): Likewise.
	* hppa-hpux-tdep.c (hppa32_hpux_find_global_pointer)
	(hppa32_hpux_search_dummy_call_sequence)
	(hppa_hpux_supply_save_state): Likewise.
	* hppa-linux-tdep.c (insns_match_pattern)
	(hppa_linux_find_global_pointer): Likewise.
	* hppa-tdep.c (hppa_in_function_epilogue_p)
	(skip_prologue_hard_way, hppa_frame_cache): Likewise.
	* i386-nto-tdep.c (i386nto_sigcontext_addr): Likewise.
	* i386fbsd-tdep.c (i386fbsd_supply_uthread)
	(i386fbsd_collect_uthread): Likewise.
	* ia64-hpux-tdep.c (ia64_hpux_push_dummy_code): Likewise.
	* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Likewise.
	* ia64-tdep.c (examine_prologue, ia64_frame_cache)
	(ia64_frame_prev_register, ia64_sigtramp_frame_cache)
	(ia64_sigtramp_frame_prev_register, ia64_access_reg)
	(ia64_access_rse_reg, ia64_libunwind_frame_this_id)
	(ia64_libunwind_frame_prev_register)
	(ia64_libunwind_sigtramp_frame_this_id)
	(ia64_find_global_pointer_from_dynamic_section)
	(find_extant_func_descr, find_func_descr, ia64_dummy_id)
	(ia64_unwind_pc): Likewise.
	* iq2000-tdep.c (iq2000_store_return_value): Likewise.
	* m68hc11-tdep.c (m68hc11_push_dummy_call)
	(m68hc11_extract_return_value): Likewise.
	* m68klinux-nat.c (fetch_register, store_register): Likewise.
	* mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_cr32_write)
	(mep_get_insn, mep_push_dummy_call): Likewise.
	* mips-linux-tdep.c (mips_linux_get_longjmp_target)
	(mips_linux_in_dynsym_stub): Likewise.
	* mn10300-tdep.c (mep_pseudo_cr32_write): Likewise.
	* ppc-linux-nat.c (fetch_register, store_register): Likewise.
	* regcache.c (dump_endian_bytes): Change type of parameter 'buf'
	to gdb_byte.
	* remote-mips.c (mips_set_register): Likewise.
	* remote-sim.c (gdbsim_fetch_register): Likewise.
	* score-tdep.c (score7_fetch_inst): Change type of parameter
	'memblock' and local 'buf' to gdb_byte.
	(score7_malloc_and_get_memblock): Change return type to gdb_byte.
	Change type of local 'buf' to gdb_byte.  Adjust.
	(score7_adjust_memblock_ptr): Change type of parameter 'memblock'
	to gdb_byte**.
	(score7_analyze_prologue): Change type of 'memblock' and
	'memblock_ptr' locals to gdb_byte*.
	* sh64-tdep.c (sh64_extract_return_value)
	(sh64_store_return_value): Change type of local 'buf' to gdb_byte.
	* solib-darwin.c (darwin_current_sos, darwin_read_exec_load_addr):
	* solib-pa64.c (pa64_solib_create_inferior_hook)
	(pa64_open_symbol_file_object): Remove local 'buf'.
	* solib-som.c (som_solib_create_inferior_hook, link_map_start)
	(som_open_symbol_file_object): Likewise.
	* solib-spu.c (spu_current_sos): Likewise.
	* spu-linux-nat.c (spu_fetch_inferior_registers): Likewise.
	* spu-multiarch.c (parse_spufs_run, spu_fetch_registers)
	(spu_store_registers): Likewise.
	* target.c (debug_print_register): Likewise.
	* tic6x-tdep.c (tic6x_get_longjmp_target): Likewise.
	* xstormy16-tdep.c (xstormy16_store_return_value)
	(xstormy16_push_dummy_call, xstormy16_resolve_jmp_table_entry)
	(xstormy16_find_jmp_table_entry): Likewise.
This commit is contained in:
Pedro Alves 2013-03-01 15:38:27 +00:00
parent 75cc61ca4a
commit e362b51003
36 changed files with 167 additions and 93 deletions

View File

@ -1,3 +1,77 @@
2013-03-01 Pedro Alves <palves@redhat.com>
Use gdb_byte for bytes from the program being debugged.
* arm-tdep.c (arm_store_return_value, arm_get_longjmp_target):
Change type of local 'buf' to gdb_byte.
* avr-tdep.c (avr_frame_prev_register, avr_push_dummy_call): Likewise.
* bfin-tdep.c (bfin_push_dummy_call): Likewise.
* cris-tdep.c (cris_sigcontext_addr)
(cris_sigtramp_frame_unwind_cache): Likewise.
* frv-linux-tdep.c (frv_linux_pc_in_sigtramp)
(frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache):
Likewise.
* frv-tdep.c (frv_pseudo_register_write, frv_analyze_prologue): Likewise.
* hppa-hpux-tdep.c (hppa32_hpux_find_global_pointer)
(hppa32_hpux_search_dummy_call_sequence)
(hppa_hpux_supply_save_state): Likewise.
* hppa-linux-tdep.c (insns_match_pattern)
(hppa_linux_find_global_pointer): Likewise.
* hppa-tdep.c (hppa_in_function_epilogue_p)
(skip_prologue_hard_way, hppa_frame_cache): Likewise.
* i386-nto-tdep.c (i386nto_sigcontext_addr): Likewise.
* i386fbsd-tdep.c (i386fbsd_supply_uthread)
(i386fbsd_collect_uthread): Likewise.
* ia64-hpux-tdep.c (ia64_hpux_push_dummy_code): Likewise.
* ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Likewise.
* ia64-tdep.c (examine_prologue, ia64_frame_cache)
(ia64_frame_prev_register, ia64_sigtramp_frame_cache)
(ia64_sigtramp_frame_prev_register, ia64_access_reg)
(ia64_access_rse_reg, ia64_libunwind_frame_this_id)
(ia64_libunwind_frame_prev_register)
(ia64_libunwind_sigtramp_frame_this_id)
(ia64_find_global_pointer_from_dynamic_section)
(find_extant_func_descr, find_func_descr, ia64_dummy_id)
(ia64_unwind_pc): Likewise.
* iq2000-tdep.c (iq2000_store_return_value): Likewise.
* m68hc11-tdep.c (m68hc11_push_dummy_call)
(m68hc11_extract_return_value): Likewise.
* m68klinux-nat.c (fetch_register, store_register): Likewise.
* mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_cr32_write)
(mep_get_insn, mep_push_dummy_call): Likewise.
* mips-linux-tdep.c (mips_linux_get_longjmp_target)
(mips_linux_in_dynsym_stub): Likewise.
* mn10300-tdep.c (mep_pseudo_cr32_write): Likewise.
* ppc-linux-nat.c (fetch_register, store_register): Likewise.
* regcache.c (dump_endian_bytes): Change type of parameter 'buf'
to gdb_byte.
* remote-mips.c (mips_set_register): Likewise.
* remote-sim.c (gdbsim_fetch_register): Likewise.
* score-tdep.c (score7_fetch_inst): Change type of parameter
'memblock' and local 'buf' to gdb_byte.
(score7_malloc_and_get_memblock): Change return type to gdb_byte.
Change type of local 'buf' to gdb_byte. Adjust.
(score7_adjust_memblock_ptr): Change type of parameter 'memblock'
to gdb_byte**.
(score7_analyze_prologue): Change type of 'memblock' and
'memblock_ptr' locals to gdb_byte*.
* sh64-tdep.c (sh64_extract_return_value)
(sh64_store_return_value): Change type of local 'buf' to gdb_byte.
* solib-darwin.c (darwin_current_sos, darwin_read_exec_load_addr):
* solib-pa64.c (pa64_solib_create_inferior_hook)
(pa64_open_symbol_file_object): Remove local 'buf'.
* solib-som.c (som_solib_create_inferior_hook, link_map_start)
(som_open_symbol_file_object): Likewise.
* solib-spu.c (spu_current_sos): Likewise.
* spu-linux-nat.c (spu_fetch_inferior_registers): Likewise.
* spu-multiarch.c (parse_spufs_run, spu_fetch_registers)
(spu_store_registers): Likewise.
* target.c (debug_print_register): Likewise.
* tic6x-tdep.c (tic6x_get_longjmp_target): Likewise.
* xstormy16-tdep.c (xstormy16_store_return_value)
(xstormy16_push_dummy_call, xstormy16_resolve_jmp_table_entry)
(xstormy16_find_jmp_table_entry): Likewise.
2013-03-01 Jiong Wang <jiwang@tilera.com> 2013-03-01 Jiong Wang <jiwang@tilera.com>
* tilegx-tdep.c (tilegx_get_longjmp_target): New function. * tilegx-tdep.c (tilegx_get_longjmp_target): New function.

View File

@ -9043,7 +9043,7 @@ arm_store_return_value (struct type *type, struct regcache *regs,
if (TYPE_CODE (type) == TYPE_CODE_FLT) if (TYPE_CODE (type) == TYPE_CODE_FLT)
{ {
char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
switch (gdbarch_tdep (gdbarch)->fp_model) switch (gdbarch_tdep (gdbarch)->fp_model)
{ {
@ -9207,7 +9207,7 @@ arm_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR jb_addr; CORE_ADDR jb_addr;
char buf[INT_REGISTER_SIZE]; gdb_byte buf[INT_REGISTER_SIZE];
jb_addr = get_frame_register_unsigned (frame, ARM_A1_REGNUM); jb_addr = get_frame_register_unsigned (frame, ARM_A1_REGNUM);

View File

@ -1103,7 +1103,7 @@ avr_frame_prev_register (struct frame_info *this_frame,
everything else about the avr is little endian. Ick! */ everything else about the avr is little endian. Ick! */
ULONGEST pc; ULONGEST pc;
int i; int i;
unsigned char buf[3]; gdb_byte buf[3];
struct gdbarch *gdbarch = get_frame_arch (this_frame); struct gdbarch *gdbarch = get_frame_arch (this_frame);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@ -1245,7 +1245,7 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{ {
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int i; int i;
unsigned char buf[3]; gdb_byte buf[3];
int call_length = gdbarch_tdep (gdbarch)->call_length; int call_length = gdbarch_tdep (gdbarch)->call_length;
CORE_ADDR return_pc = avr_convert_iaddr_to_raw (bp_addr); CORE_ADDR return_pc = avr_convert_iaddr_to_raw (bp_addr);
int regnum = AVR_ARGN_REGNUM; int regnum = AVR_ARGN_REGNUM;

View File

@ -503,7 +503,7 @@ bfin_push_dummy_call (struct gdbarch *gdbarch,
{ {
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
char buf[4]; gdb_byte buf[4];
int i; int i;
long reg_r0, reg_r1, reg_r2; long reg_r0, reg_r1, reg_r2;
int total_len = 0; int total_len = 0;

View File

@ -261,7 +261,7 @@ cris_sigcontext_addr (struct frame_info *this_frame)
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR pc; CORE_ADDR pc;
CORE_ADDR sp; CORE_ADDR sp;
char buf[4]; gdb_byte buf[4];
get_frame_register (this_frame, gdbarch_sp_regnum (gdbarch), buf); get_frame_register (this_frame, gdbarch_sp_regnum (gdbarch), buf);
sp = extract_unsigned_integer (buf, 4, byte_order); sp = extract_unsigned_integer (buf, 4, byte_order);
@ -323,7 +323,7 @@ cris_sigtramp_frame_unwind_cache (struct frame_info *this_frame,
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct cris_unwind_cache *info; struct cris_unwind_cache *info;
CORE_ADDR addr; CORE_ADDR addr;
char buf[4]; gdb_byte buf[4];
int i; int i;
if ((*this_cache)) if ((*this_cache))

View File

@ -46,7 +46,7 @@ frv_linux_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc,
const char *name) const char *name)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
char buf[frv_instr_size]; gdb_byte buf[frv_instr_size];
LONGEST instr; LONGEST instr;
int retval = 0; int retval = 0;
@ -182,7 +182,7 @@ frv_linux_sigcontext_reg_addr (struct frame_info *this_frame, int regno,
else else
{ {
CORE_ADDR pc, sp; CORE_ADDR pc, sp;
char buf[4]; gdb_byte buf[4];
int tramp_type; int tramp_type;
pc = get_frame_pc (this_frame); pc = get_frame_pc (this_frame);
@ -266,7 +266,7 @@ frv_linux_sigtramp_frame_cache (struct frame_info *this_frame,
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct trad_frame_cache *cache; struct trad_frame_cache *cache;
CORE_ADDR addr; CORE_ADDR addr;
char buf[4]; gdb_byte buf[4];
int regnum; int regnum;
CORE_ADDR sc_addr_cache_val = 0; CORE_ADDR sc_addr_cache_val = 0;
struct frame_id this_id; struct frame_id this_id;

View File

@ -351,7 +351,7 @@ frv_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int raw_regnum = accg0123_regnum + (reg - accg0_regnum) / 4; int raw_regnum = accg0123_regnum + (reg - accg0_regnum) / 4;
int byte_num = (reg - accg0_regnum) % 4; int byte_num = (reg - accg0_regnum) % 4;
char buf[4]; gdb_byte buf[4];
regcache_raw_read (regcache, raw_regnum, buf); regcache_raw_read (regcache, raw_regnum, buf);
buf[byte_num] = ((bfd_byte *) buffer)[0]; buf[byte_num] = ((bfd_byte *) buffer)[0];
@ -602,7 +602,7 @@ frv_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
/* Scan the prologue. */ /* Scan the prologue. */
while (pc < lim_pc) while (pc < lim_pc)
{ {
char buf[frv_instr_size]; gdb_byte buf[frv_instr_size];
LONGEST op; LONGEST op;
if (target_read_memory (pc, buf, sizeof buf) != 0) if (target_read_memory (pc, buf, sizeof buf) != 0)

View File

@ -772,7 +772,7 @@ hppa32_hpux_find_global_pointer (struct gdbarch *gdbarch,
if (faddr & 2) if (faddr & 2)
{ {
int status; int status;
char buf[4]; gdb_byte buf[4];
faddr &= ~3; faddr &= ~3;
@ -790,7 +790,7 @@ hppa64_hpux_find_global_pointer (struct gdbarch *gdbarch,
{ {
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR faddr; CORE_ADDR faddr;
char buf[32]; gdb_byte buf[32];
faddr = value_as_address (function); faddr = value_as_address (function);
@ -857,7 +857,7 @@ hppa32_hpux_search_dummy_call_sequence (struct gdbarch *gdbarch, CORE_ADDR pc,
struct frame_info *frame; struct frame_info *frame;
struct unwind_table_entry *u; struct unwind_table_entry *u;
CORE_ADDR addr, rp; CORE_ADDR addr, rp;
char buf[4]; gdb_byte buf[4];
unsigned int insn; unsigned int insn;
sec = find_pc_section (pc); sec = find_pc_section (pc);
@ -1355,7 +1355,7 @@ hppa_hpux_supply_save_state (const struct regset *regset,
if (regnum == -1 || regnum == HPPA_FLAGS_REGNUM) if (regnum == -1 || regnum == HPPA_FLAGS_REGNUM)
{ {
size_t size = register_size (gdbarch, HPPA_FLAGS_REGNUM); size_t size = register_size (gdbarch, HPPA_FLAGS_REGNUM);
char buf[8]; gdb_byte buf[8];
store_unsigned_integer (buf, size, byte_order, flags); store_unsigned_integer (buf, size, byte_order, flags);
regcache_raw_supply (regcache, HPPA_FLAGS_REGNUM, buf); regcache_raw_supply (regcache, HPPA_FLAGS_REGNUM, buf);

View File

@ -98,7 +98,7 @@ insns_match_pattern (struct gdbarch *gdbarch, CORE_ADDR pc,
for (i = 0; pattern[i].mask; i++) for (i = 0; pattern[i].mask; i++)
{ {
char buf[4]; gdb_byte buf[4];
target_read_memory (npc, buf, 4); target_read_memory (npc, buf, 4);
insn[i] = extract_unsigned_integer (buf, 4, byte_order); insn[i] = extract_unsigned_integer (buf, 4, byte_order);
@ -344,7 +344,7 @@ hppa_linux_find_global_pointer (struct gdbarch *gdbarch,
if (faddr & 2) if (faddr & 2)
{ {
int status; int status;
char buf[4]; gdb_byte buf[4];
faddr &= ~3; faddr &= ~3;
@ -381,7 +381,7 @@ hppa_linux_find_global_pointer (struct gdbarch *gdbarch,
{ {
int status; int status;
LONGEST tag; LONGEST tag;
char buf[4]; gdb_byte buf[4];
status = target_read_memory (addr, buf, sizeof (buf)); status = target_read_memory (addr, buf, sizeof (buf));
if (status != 0) if (status != 0)

View File

@ -541,7 +541,7 @@ hppa_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
unsigned long status; unsigned long status;
unsigned int inst; unsigned int inst;
char buf[4]; gdb_byte buf[4];
status = target_read_memory (pc, buf, 4); status = target_read_memory (pc, buf, 4);
if (status != 0) if (status != 0)
@ -1446,7 +1446,7 @@ skip_prologue_hard_way (struct gdbarch *gdbarch, CORE_ADDR pc,
int stop_before_branch) int stop_before_branch)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
char buf[4]; gdb_byte buf[4];
CORE_ADDR orig_pc = pc; CORE_ADDR orig_pc = pc;
unsigned long inst, stack_remaining, save_gr, save_fr, save_rp, save_sp; unsigned long inst, stack_remaining, save_gr, save_fr, save_rp, save_sp;
unsigned long args_stored, status, i, restart_gr, restart_fr; unsigned long args_stored, status, i, restart_gr, restart_fr;
@ -1897,7 +1897,7 @@ hppa_frame_cache (struct frame_info *this_frame, void **this_cache)
pc += 4) pc += 4)
{ {
int reg; int reg;
char buf4[4]; gdb_byte buf4[4];
long inst; long inst;
if (!safe_frame_unwind_memory (this_frame, pc, buf4, sizeof buf4)) if (!safe_frame_unwind_memory (this_frame, pc, buf4, sizeof buf4))

View File

@ -294,7 +294,7 @@ i386nto_sigcontext_addr (struct frame_info *this_frame)
{ {
struct gdbarch *gdbarch = get_frame_arch (this_frame); struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
char buf[4]; gdb_byte buf[4];
CORE_ADDR ptrctx; CORE_ADDR ptrctx;
/* We store __ucontext_t addr in EDI register. */ /* We store __ucontext_t addr in EDI register. */

View File

@ -86,7 +86,7 @@ static void
i386fbsd_supply_uthread (struct regcache *regcache, i386fbsd_supply_uthread (struct regcache *regcache,
int regnum, CORE_ADDR addr) int regnum, CORE_ADDR addr)
{ {
char buf[4]; gdb_byte buf[4];
int i; int i;
gdb_assert (regnum >= -1); gdb_assert (regnum >= -1);
@ -106,7 +106,7 @@ static void
i386fbsd_collect_uthread (const struct regcache *regcache, i386fbsd_collect_uthread (const struct regcache *regcache,
int regnum, CORE_ADDR addr) int regnum, CORE_ADDR addr)
{ {
char buf[4]; gdb_byte buf[4];
int i; int i;
gdb_assert (regnum >= -1); gdb_assert (regnum >= -1);

View File

@ -265,7 +265,7 @@ ia64_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
{ {
ULONGEST cfm; ULONGEST cfm;
int sof, sol, sor, soo; int sof, sol, sor, soo;
char buf[16]; gdb_byte buf[16];
regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm); regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm);
sof = cfm & 0x7f; sof = cfm & 0x7f;

View File

@ -54,7 +54,7 @@ ia64_linux_sigcontext_register_address (struct gdbarch *gdbarch,
CORE_ADDR sp, int regno) CORE_ADDR sp, int regno)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
char buf[8]; gdb_byte buf[8];
CORE_ADDR sigcontext_addr = 0; CORE_ADDR sigcontext_addr = 0;
/* The address of the sigcontext area is found at offset 16 in the /* The address of the sigcontext area is found at offset 16 in the

View File

@ -1380,7 +1380,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc,
int frameless = 1; int frameless = 1;
int i; int i;
CORE_ADDR addr; CORE_ADDR addr;
char buf[8]; gdb_byte buf[8];
CORE_ADDR bof, sor, sol, sof, cfm, rrb_gr; CORE_ADDR bof, sor, sol, sof, cfm, rrb_gr;
memset (instores, 0, sizeof instores); memset (instores, 0, sizeof instores);
@ -1514,7 +1514,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc,
else if (qp == 0 && rN == 2 else if (qp == 0 && rN == 2
&& ((rM == fp_reg && fp_reg != 0) || rM == 12)) && ((rM == fp_reg && fp_reg != 0) || rM == 12))
{ {
char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
CORE_ADDR saved_sp = 0; CORE_ADDR saved_sp = 0;
/* adds r2, spilloffset, rFramePointer /* adds r2, spilloffset, rFramePointer
or or
@ -1850,7 +1850,7 @@ ia64_frame_cache (struct frame_info *this_frame, void **this_cache)
struct gdbarch *gdbarch = get_frame_arch (this_frame); struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct ia64_frame_cache *cache; struct ia64_frame_cache *cache;
char buf[8]; gdb_byte buf[8];
CORE_ADDR cfm, psr; CORE_ADDR cfm, psr;
if (*this_cache) if (*this_cache)
@ -1918,7 +1918,7 @@ ia64_frame_prev_register (struct frame_info *this_frame, void **this_cache,
struct gdbarch *gdbarch = get_frame_arch (this_frame); struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct ia64_frame_cache *cache = ia64_frame_cache (this_frame, this_cache); struct ia64_frame_cache *cache = ia64_frame_cache (this_frame, this_cache);
char buf[8]; gdb_byte buf[8];
gdb_assert (regnum >= 0); gdb_assert (regnum >= 0);
@ -2238,7 +2238,7 @@ ia64_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
struct gdbarch *gdbarch = get_frame_arch (this_frame); struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct ia64_frame_cache *cache; struct ia64_frame_cache *cache;
char buf[8]; gdb_byte buf[8];
if (*this_cache) if (*this_cache)
return *this_cache; return *this_cache;
@ -2288,7 +2288,7 @@ static struct value *
ia64_sigtramp_frame_prev_register (struct frame_info *this_frame, ia64_sigtramp_frame_prev_register (struct frame_info *this_frame,
void **this_cache, int regnum) void **this_cache, int regnum)
{ {
char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
struct gdbarch *gdbarch = get_frame_arch (this_frame); struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@ -2494,7 +2494,7 @@ ia64_access_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_word_t *val,
struct gdbarch *gdbarch = get_frame_arch (this_frame); struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
long new_sof, old_sof; long new_sof, old_sof;
char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
/* We never call any libunwind routines that need to write registers. */ /* We never call any libunwind routines that need to write registers. */
gdb_assert (!write); gdb_assert (!write);
@ -2574,7 +2574,7 @@ ia64_access_rse_reg (unw_addr_space_t as, unw_regnum_t uw_regnum,
struct gdbarch *gdbarch = get_regcache_arch (regcache); struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
long new_sof, old_sof; long new_sof, old_sof;
char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
/* We never call any libunwind routines that need to write registers. */ /* We never call any libunwind routines that need to write registers. */
gdb_assert (!write); gdb_assert (!write);
@ -2929,7 +2929,7 @@ ia64_libunwind_frame_this_id (struct frame_info *this_frame, void **this_cache,
struct gdbarch *gdbarch = get_frame_arch (this_frame); struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct frame_id id = outer_frame_id; struct frame_id id = outer_frame_id;
char buf[8]; gdb_byte buf[8];
CORE_ADDR bsp; CORE_ADDR bsp;
libunwind_frame_this_id (this_frame, this_cache, &id); libunwind_frame_this_id (this_frame, this_cache, &id);
@ -2981,7 +2981,7 @@ ia64_libunwind_frame_prev_register (struct frame_info *this_frame,
{ {
int rrb_pr = 0; int rrb_pr = 0;
ULONGEST cfm; ULONGEST cfm;
unsigned char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
/* Fetch predicate register rename base from current frame /* Fetch predicate register rename base from current frame
marker for this frame. */ marker for this frame. */
@ -3060,7 +3060,7 @@ ia64_libunwind_sigtramp_frame_this_id (struct frame_info *this_frame,
{ {
struct gdbarch *gdbarch = get_frame_arch (this_frame); struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
char buf[8]; gdb_byte buf[8];
CORE_ADDR bsp; CORE_ADDR bsp;
struct frame_id id = outer_frame_id; struct frame_id id = outer_frame_id;
CORE_ADDR prev_ip; CORE_ADDR prev_ip;
@ -3480,7 +3480,7 @@ ia64_find_global_pointer_from_dynamic_section (struct gdbarch *gdbarch,
{ {
int status; int status;
LONGEST tag; LONGEST tag;
char buf[8]; gdb_byte buf[8];
status = target_read_memory (addr, buf, sizeof (buf)); status = target_read_memory (addr, buf, sizeof (buf));
if (status != 0) if (status != 0)
@ -3563,7 +3563,7 @@ find_extant_func_descr (struct gdbarch *gdbarch, CORE_ADDR faddr)
{ {
int status; int status;
LONGEST faddr2; LONGEST faddr2;
char buf[8]; gdb_byte buf[8];
status = target_read_memory (addr, buf, sizeof (buf)); status = target_read_memory (addr, buf, sizeof (buf));
if (status != 0) if (status != 0)
@ -3596,7 +3596,7 @@ find_func_descr (struct regcache *regcache, CORE_ADDR faddr, CORE_ADDR *fdaptr)
if (fdesc == 0) if (fdesc == 0)
{ {
ULONGEST global_pointer; ULONGEST global_pointer;
char buf[16]; gdb_byte buf[16];
fdesc = *fdaptr; fdesc = *fdaptr;
*fdaptr += 16; *fdaptr += 16;
@ -3903,7 +3903,7 @@ static struct frame_id
ia64_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) ia64_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
char buf[8]; gdb_byte buf[8];
CORE_ADDR sp, bsp; CORE_ADDR sp, bsp;
get_frame_register (this_frame, sp_regnum, buf); get_frame_register (this_frame, sp_regnum, buf);
@ -3925,7 +3925,7 @@ static CORE_ADDR
ia64_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) ia64_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
char buf[8]; gdb_byte buf[8];
CORE_ADDR ip, psr, pc; CORE_ADDR ip, psr, pc;
frame_unwind_register (next_frame, IA64_IP_REGNUM, buf); frame_unwind_register (next_frame, IA64_IP_REGNUM, buf);

View File

@ -508,7 +508,7 @@ iq2000_store_return_value (struct type *type, struct regcache *regcache,
while (len > 0) while (len > 0)
{ {
char buf[4]; gdb_byte buf[4];
int size = len % 4 ?: 4; int size = len % 4 ?: 4;
memset (buf, 0, 4); memset (buf, 0, 4);

View File

@ -1174,7 +1174,7 @@ m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
int first_stack_argnum; int first_stack_argnum;
struct type *type; struct type *type;
char *val; char *val;
char buf[2]; gdb_byte buf[2];
first_stack_argnum = 0; first_stack_argnum = 0;
if (struct_return) if (struct_return)
@ -1288,7 +1288,7 @@ static void
m68hc11_extract_return_value (struct type *type, struct regcache *regcache, m68hc11_extract_return_value (struct type *type, struct regcache *regcache,
void *valbuf) void *valbuf)
{ {
char buf[M68HC11_REG_SIZE]; gdb_byte buf[M68HC11_REG_SIZE];
regcache_raw_read (regcache, HARD_D_REGNUM, buf); regcache_raw_read (regcache, HARD_D_REGNUM, buf);
switch (TYPE_LENGTH (type)) switch (TYPE_LENGTH (type))

View File

@ -109,7 +109,7 @@ fetch_register (struct regcache *regcache, int regno)
struct gdbarch *gdbarch = get_regcache_arch (regcache); struct gdbarch *gdbarch = get_regcache_arch (regcache);
long regaddr, val; long regaddr, val;
int i; int i;
char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
int tid; int tid;
/* Overload thread id onto process id. */ /* Overload thread id onto process id. */
@ -164,7 +164,7 @@ store_register (const struct regcache *regcache, int regno)
long regaddr, val; long regaddr, val;
int i; int i;
int tid; int tid;
char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
/* Overload thread id onto process id. */ /* Overload thread id onto process id. */
tid = TIDGET (inferior_ptid); tid = TIDGET (inferior_ptid);

View File

@ -1143,7 +1143,7 @@ mep_pseudo_cr32_read (struct gdbarch *gdbarch,
/* Read the raw register into a 64-bit buffer, and then return the /* Read the raw register into a 64-bit buffer, and then return the
appropriate end of that buffer. */ appropriate end of that buffer. */
int rawnum = mep_pseudo_to_raw[cookednum]; int rawnum = mep_pseudo_to_raw[cookednum];
char buf64[8]; gdb_byte buf64[8];
gdb_assert (TYPE_LENGTH (register_type (gdbarch, rawnum)) == sizeof (buf64)); gdb_assert (TYPE_LENGTH (register_type (gdbarch, rawnum)) == sizeof (buf64));
gdb_assert (TYPE_LENGTH (register_type (gdbarch, cookednum)) == 4); gdb_assert (TYPE_LENGTH (register_type (gdbarch, cookednum)) == 4);
@ -1229,7 +1229,7 @@ mep_pseudo_cr32_write (struct gdbarch *gdbarch,
/* Expand the 32-bit value into a 64-bit value, and write that to /* Expand the 32-bit value into a 64-bit value, and write that to
the pseudoregister. */ the pseudoregister. */
int rawnum = mep_pseudo_to_raw[cookednum]; int rawnum = mep_pseudo_to_raw[cookednum];
char buf64[8]; gdb_byte buf64[8];
gdb_assert (TYPE_LENGTH (register_type (gdbarch, rawnum)) == sizeof (buf64)); gdb_assert (TYPE_LENGTH (register_type (gdbarch, rawnum)) == sizeof (buf64));
gdb_assert (TYPE_LENGTH (register_type (gdbarch, cookednum)) == 4); gdb_assert (TYPE_LENGTH (register_type (gdbarch, cookednum)) == 4);
@ -1430,7 +1430,7 @@ mep_get_insn (struct gdbarch *gdbarch, CORE_ADDR pc, long *insn)
int pc_in_vliw_section; int pc_in_vliw_section;
int vliw_mode; int vliw_mode;
int insn_len; int insn_len;
char buf[2]; gdb_byte buf[2];
*insn = 0; *insn = 0;
@ -2358,7 +2358,7 @@ mep_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
} }
else else
{ {
char buf[MEP_GPR_SIZE]; gdb_byte buf[MEP_GPR_SIZE];
store_unsigned_integer (buf, MEP_GPR_SIZE, byte_order, value); store_unsigned_integer (buf, MEP_GPR_SIZE, byte_order, value);
write_memory (arg_stack, buf, MEP_GPR_SIZE); write_memory (arg_stack, buf, MEP_GPR_SIZE);
arg_stack += MEP_GPR_SIZE; arg_stack += MEP_GPR_SIZE;

View File

@ -59,7 +59,7 @@ mips_linux_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
CORE_ADDR jb_addr; CORE_ADDR jb_addr;
struct gdbarch *gdbarch = get_frame_arch (frame); struct gdbarch *gdbarch = get_frame_arch (frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
char buf[gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT]; gdb_byte buf[gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT];
jb_addr = get_frame_register_unsigned (frame, MIPS_A0_REGNUM); jb_addr = get_frame_register_unsigned (frame, MIPS_A0_REGNUM);
@ -680,7 +680,7 @@ mips_linux_core_read_description (struct gdbarch *gdbarch,
static int static int
mips_linux_in_dynsym_stub (CORE_ADDR pc, char *name) mips_linux_in_dynsym_stub (CORE_ADDR pc, char *name)
{ {
unsigned char buf[28], *p; gdb_byte buf[28], *p;
ULONGEST insn, insn1; ULONGEST insn, insn1;
int n64 = (mips_abi (target_gdbarch ()) == MIPS_ABI_N64); int n64 = (mips_abi (target_gdbarch ()) == MIPS_ABI_N64);
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ()); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());

View File

@ -198,7 +198,7 @@ static void
mn10300_extract_return_value (struct gdbarch *gdbarch, struct type *type, mn10300_extract_return_value (struct gdbarch *gdbarch, struct type *type,
struct regcache *regcache, void *valbuf) struct regcache *regcache, void *valbuf)
{ {
char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
int len = TYPE_LENGTH (type); int len = TYPE_LENGTH (type);
int reg, regsz; int reg, regsz;

View File

@ -547,7 +547,7 @@ fetch_register (struct regcache *regcache, int tid, int regno)
CORE_ADDR regaddr = ppc_register_u_addr (gdbarch, regno); CORE_ADDR regaddr = ppc_register_u_addr (gdbarch, regno);
int bytes_transferred; int bytes_transferred;
unsigned int offset; /* Offset of registers within the u area. */ unsigned int offset; /* Offset of registers within the u area. */
char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
if (altivec_register_p (gdbarch, regno)) if (altivec_register_p (gdbarch, regno))
{ {
@ -1034,7 +1034,7 @@ store_register (const struct regcache *regcache, int tid, int regno)
CORE_ADDR regaddr = ppc_register_u_addr (gdbarch, regno); CORE_ADDR regaddr = ppc_register_u_addr (gdbarch, regno);
int i; int i;
size_t bytes_to_transfer; size_t bytes_to_transfer;
char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
if (altivec_register_p (gdbarch, regno)) if (altivec_register_p (gdbarch, regno))
{ {

View File

@ -1092,7 +1092,7 @@ reg_flush_command (char *command, int from_tty)
static void static void
dump_endian_bytes (struct ui_file *file, enum bfd_endian endian, dump_endian_bytes (struct ui_file *file, enum bfd_endian endian,
const unsigned char *buf, long len) const gdb_byte *buf, long len)
{ {
int i; int i;
@ -1130,7 +1130,7 @@ regcache_dump (struct regcache *regcache, struct ui_file *file,
int footnote_register_offset = 0; int footnote_register_offset = 0;
int footnote_register_type_name_null = 0; int footnote_register_type_name_null = 0;
long register_offset = 0; long register_offset = 0;
unsigned char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
#if 0 #if 0
fprintf_unfiltered (file, "nr_raw_registers %d\n", fprintf_unfiltered (file, "nr_raw_registers %d\n",

View File

@ -1794,7 +1794,7 @@ mips_signal_from_protocol (int sig)
static void static void
mips_set_register (int regno, ULONGEST value) mips_set_register (int regno, ULONGEST value)
{ {
char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
struct regcache *regcache = get_current_regcache (); struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache); struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);

View File

@ -446,7 +446,7 @@ gdbsim_fetch_register (struct target_ops *ops,
{ {
/* For moment treat a `does not exist' register the same way /* For moment treat a `does not exist' register the same way
as an ``unavailable'' register. */ as an ``unavailable'' register. */
char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
int nr_bytes; int nr_bytes;
memset (buf, 0, MAX_REGISTER_SIZE); memset (buf, 0, MAX_REGISTER_SIZE);
@ -457,7 +457,7 @@ gdbsim_fetch_register (struct target_ops *ops,
default: default:
{ {
static int warn_user = 1; static int warn_user = 1;
char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
int nr_bytes; int nr_bytes;
gdb_assert (regno >= 0 && regno < gdbarch_num_regs (gdbarch)); gdb_assert (regno >= 0 && regno < gdbarch_num_regs (gdbarch));

View File

@ -137,11 +137,11 @@ score_print_insn (bfd_vma memaddr, struct disassemble_info *info)
} }
static inst_t * static inst_t *
score7_fetch_inst (struct gdbarch *gdbarch, CORE_ADDR addr, char *memblock) score7_fetch_inst (struct gdbarch *gdbarch, CORE_ADDR addr, gdb_byte *memblock)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
static inst_t inst = { 0, 0, 0 }; static inst_t inst = { 0, 0, 0 };
char buf[SCORE_INSTLEN] = { 0 }; gdb_byte buf[SCORE_INSTLEN] = { 0 };
int big; int big;
int ret; int ret;
@ -807,11 +807,11 @@ score3_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR cur_pc)
return 0; return 0;
} }
static char * static gdb_byte *
score7_malloc_and_get_memblock (CORE_ADDR addr, CORE_ADDR size) score7_malloc_and_get_memblock (CORE_ADDR addr, CORE_ADDR size)
{ {
int ret; int ret;
char *memblock = NULL; gdb_byte *memblock = NULL;
if (size < 0) if (size < 0)
{ {
@ -822,7 +822,7 @@ score7_malloc_and_get_memblock (CORE_ADDR addr, CORE_ADDR size)
else if (size == 0) else if (size == 0)
return NULL; return NULL;
memblock = (char *) xmalloc (size); memblock = xmalloc (size);
memset (memblock, 0, size); memset (memblock, 0, size);
ret = target_read_memory (addr & ~0x3, memblock, size); ret = target_read_memory (addr & ~0x3, memblock, size);
if (ret) if (ret)
@ -841,7 +841,7 @@ score7_free_memblock (char *memblock)
} }
static void static void
score7_adjust_memblock_ptr (char **memblock, CORE_ADDR prev_pc, score7_adjust_memblock_ptr (gdb_byte **memblock, CORE_ADDR prev_pc,
CORE_ADDR cur_pc) CORE_ADDR cur_pc)
{ {
if (prev_pc == -1) if (prev_pc == -1)
@ -877,8 +877,8 @@ score7_analyze_prologue (CORE_ADDR startaddr, CORE_ADDR pc,
int fp_offset_p = 0; int fp_offset_p = 0;
int inst_len = 0; int inst_len = 0;
char *memblock = NULL; gdb_byte *memblock = NULL;
char *memblock_ptr = NULL; gdb_byte *memblock_ptr = NULL;
CORE_ADDR prev_pc = -1; CORE_ADDR prev_pc = -1;
/* Allocate MEMBLOCK if PC - STARTADDR > 0. */ /* Allocate MEMBLOCK if PC - STARTADDR > 0. */

View File

@ -1261,7 +1261,7 @@ sh64_extract_return_value (struct type *type, struct regcache *regcache,
if (len <= 8) if (len <= 8)
{ {
int offset; int offset;
char buf[8]; gdb_byte buf[8];
/* Result is in register 2. If smaller than 8 bytes, it is padded /* Result is in register 2. If smaller than 8 bytes, it is padded
at the most significant end. */ at the most significant end. */
regcache_raw_read (regcache, DEFAULT_RETURN_REGNUM, buf); regcache_raw_read (regcache, DEFAULT_RETURN_REGNUM, buf);
@ -1290,7 +1290,7 @@ sh64_store_return_value (struct type *type, struct regcache *regcache,
const void *valbuf) const void *valbuf)
{ {
struct gdbarch *gdbarch = get_regcache_arch (regcache); 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); int len = TYPE_LENGTH (type);
if (TYPE_CODE (type) == TYPE_CODE_FLT) if (TYPE_CODE (type) == TYPE_CODE_FLT)

View File

@ -269,7 +269,7 @@ darwin_current_sos (void)
for (i = 0; i < info->all_image.count; i++) for (i = 0; i < info->all_image.count; i++)
{ {
CORE_ADDR iinfo = info->all_image.info + i * image_info_size; CORE_ADDR iinfo = info->all_image.info + i * image_info_size;
char buf[image_info_size]; gdb_byte buf[image_info_size];
CORE_ADDR load_addr; CORE_ADDR load_addr;
CORE_ADDR path_addr; CORE_ADDR path_addr;
struct mach_o_header_external hdr; struct mach_o_header_external hdr;
@ -347,7 +347,7 @@ darwin_read_exec_load_addr (struct darwin_info *info)
for (i = 0; i < info->all_image.count; i++) for (i = 0; i < info->all_image.count; i++)
{ {
CORE_ADDR iinfo = info->all_image.info + i * image_info_size; CORE_ADDR iinfo = info->all_image.info + i * image_info_size;
char buf[image_info_size]; gdb_byte buf[image_info_size];
CORE_ADDR load_addr; CORE_ADDR load_addr;
struct mach_o_header_external hdr; struct mach_o_header_external hdr;
unsigned long hdr_val; unsigned long hdr_val;

View File

@ -298,7 +298,6 @@ pa64_solib_create_inferior_hook (int from_tty)
struct minimal_symbol *msymbol; struct minimal_symbol *msymbol;
unsigned int dld_flags, status; unsigned int dld_flags, status;
asection *shlib_info, *interp_sect; asection *shlib_info, *interp_sect;
char buf[4];
struct objfile *objfile; struct objfile *objfile;
CORE_ADDR anaddr; CORE_ADDR anaddr;
@ -488,7 +487,6 @@ static int
pa64_open_symbol_file_object (void *from_ttyp) pa64_open_symbol_file_object (void *from_ttyp)
{ {
int from_tty = *(int *)from_ttyp; int from_tty = *(int *)from_ttyp;
char buf[4];
struct load_module_desc dll_desc; struct load_module_desc dll_desc;
char *dll_path; char *dll_path;

View File

@ -189,7 +189,7 @@ som_solib_create_inferior_hook (int from_tty)
struct minimal_symbol *msymbol; struct minimal_symbol *msymbol;
unsigned int dld_flags, status, have_endo; unsigned int dld_flags, status, have_endo;
asection *shlib_info; asection *shlib_info;
char buf[4]; gdb_byte buf[4];
CORE_ADDR anaddr; CORE_ADDR anaddr;
if (symfile_objfile == NULL) if (symfile_objfile == NULL)
@ -528,7 +528,7 @@ link_map_start (void)
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ()); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct minimal_symbol *sym; struct minimal_symbol *sym;
CORE_ADDR addr; CORE_ADDR addr;
char buf[4]; gdb_byte buf[4];
unsigned int dld_flags; unsigned int dld_flags;
sym = lookup_minimal_symbol ("__dld_flags", NULL, NULL); sym = lookup_minimal_symbol ("__dld_flags", NULL, NULL);
@ -697,7 +697,7 @@ som_open_symbol_file_object (void *from_ttyp)
char *filename; char *filename;
int errcode; int errcode;
int from_tty = *(int *)from_ttyp; int from_tty = *(int *)from_ttyp;
char buf[4]; gdb_byte buf[4];
if (symfile_objfile) if (symfile_objfile)
if (!query (_("Attempt to reload symbols from process? "))) if (!query (_("Attempt to reload symbols from process? ")))

View File

@ -162,7 +162,7 @@ spu_current_sos (void)
struct so_list *head; struct so_list *head;
struct so_list **link_ptr; struct so_list **link_ptr;
char buf[MAX_SPE_FD * 4]; gdb_byte buf[MAX_SPE_FD * 4];
int i, size; int i, size;
/* First, retrieve the SVR4 shared library list. */ /* First, retrieve the SVR4 shared library list. */

View File

@ -493,7 +493,7 @@ spu_fetch_inferior_registers (struct target_ops *ops,
{ {
struct gdbarch *gdbarch = get_regcache_arch (regcache); struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
char buf[4]; gdb_byte buf[4];
store_unsigned_integer (buf, 4, byte_order, fd); store_unsigned_integer (buf, 4, byte_order, fd);
regcache_raw_supply (regcache, SPU_ID_REGNUM, buf); regcache_raw_supply (regcache, SPU_ID_REGNUM, buf);
} }

View File

@ -60,7 +60,7 @@ parse_spufs_run (ptid_t ptid, int *fd, CORE_ADDR *addr)
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ()); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct gdbarch_tdep *tdep; struct gdbarch_tdep *tdep;
struct regcache *regcache; struct regcache *regcache;
char buf[4]; gdb_byte buf[4];
ULONGEST regval; ULONGEST regval;
/* If we're not on PPU, there's nothing to detect. */ /* If we're not on PPU, there's nothing to detect. */
@ -163,7 +163,7 @@ spu_fetch_registers (struct target_ops *ops,
/* The ID register holds the spufs file handle. */ /* The ID register holds the spufs file handle. */
if (regno == -1 || regno == SPU_ID_REGNUM) if (regno == -1 || regno == SPU_ID_REGNUM)
{ {
char buf[4]; gdb_byte buf[4];
store_unsigned_integer (buf, 4, byte_order, spufs_fd); store_unsigned_integer (buf, 4, byte_order, spufs_fd);
regcache_raw_supply (regcache, SPU_ID_REGNUM, buf); regcache_raw_supply (regcache, SPU_ID_REGNUM, buf);
} }
@ -171,7 +171,7 @@ spu_fetch_registers (struct target_ops *ops,
/* The NPC register is found in PPC memory at SPUFS_ADDR. */ /* The NPC register is found in PPC memory at SPUFS_ADDR. */
if (regno == -1 || regno == SPU_PC_REGNUM) if (regno == -1 || regno == SPU_PC_REGNUM)
{ {
char buf[4]; gdb_byte buf[4];
if (target_read (ops_beneath, TARGET_OBJECT_MEMORY, NULL, if (target_read (ops_beneath, TARGET_OBJECT_MEMORY, NULL,
buf, spufs_addr, sizeof buf) == sizeof buf) buf, spufs_addr, sizeof buf) == sizeof buf)
@ -181,7 +181,8 @@ spu_fetch_registers (struct target_ops *ops,
/* The GPRs are found in the "regs" spufs file. */ /* The GPRs are found in the "regs" spufs file. */
if (regno == -1 || (regno >= 0 && regno < SPU_NUM_GPRS)) if (regno == -1 || (regno >= 0 && regno < SPU_NUM_GPRS))
{ {
char buf[16 * SPU_NUM_GPRS], annex[32]; gdb_byte buf[16 * SPU_NUM_GPRS];
char annex[32];
int i; int i;
xsnprintf (annex, sizeof annex, "%d/regs", spufs_fd); xsnprintf (annex, sizeof annex, "%d/regs", spufs_fd);
@ -220,7 +221,7 @@ spu_store_registers (struct target_ops *ops,
/* The NPC register is found in PPC memory at SPUFS_ADDR. */ /* The NPC register is found in PPC memory at SPUFS_ADDR. */
if (regno == -1 || regno == SPU_PC_REGNUM) if (regno == -1 || regno == SPU_PC_REGNUM)
{ {
char buf[4]; gdb_byte buf[4];
regcache_raw_collect (regcache, SPU_PC_REGNUM, buf); regcache_raw_collect (regcache, SPU_PC_REGNUM, buf);
target_write (ops_beneath, TARGET_OBJECT_MEMORY, NULL, target_write (ops_beneath, TARGET_OBJECT_MEMORY, NULL,
@ -230,7 +231,8 @@ spu_store_registers (struct target_ops *ops,
/* The GPRs are found in the "regs" spufs file. */ /* The GPRs are found in the "regs" spufs file. */
if (regno == -1 || (regno >= 0 && regno < SPU_NUM_GPRS)) if (regno == -1 || (regno >= 0 && regno < SPU_NUM_GPRS))
{ {
char buf[16 * SPU_NUM_GPRS], annex[32]; gdb_byte buf[16 * SPU_NUM_GPRS];
char annex[32];
int i; int i;
for (i = 0; i < SPU_NUM_GPRS; i++) for (i = 0; i < SPU_NUM_GPRS; i++)

View File

@ -3957,7 +3957,7 @@ debug_print_register (const char * func,
{ {
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int i, size = register_size (gdbarch, regno); int i, size = register_size (gdbarch, regno);
unsigned char buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
regcache_raw_collect (regcache, regno, buf); regcache_raw_collect (regcache, regno, buf);
fprintf_unfiltered (gdb_stdlog, " = "); fprintf_unfiltered (gdb_stdlog, " = ");

View File

@ -1150,7 +1150,7 @@ tic6x_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
struct gdbarch *gdbarch = get_frame_arch (frame); struct gdbarch *gdbarch = get_frame_arch (frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR jb_addr; CORE_ADDR jb_addr;
char buf[4]; gdb_byte buf[4];
/* JMP_BUF is passed by reference in A4. */ /* JMP_BUF is passed by reference in A4. */
jb_addr = get_frame_register_unsigned (frame, 4); jb_addr = get_frame_register_unsigned (frame, 4);

View File

@ -181,7 +181,7 @@ xstormy16_store_return_value (struct type *type, struct regcache *regcache,
if (TYPE_LENGTH (type) == 1) if (TYPE_LENGTH (type) == 1)
{ {
/* Add leading zeros to the value. */ /* Add leading zeros to the value. */
char buf[xstormy16_reg_size]; gdb_byte buf[xstormy16_reg_size];
memset (buf, 0, xstormy16_reg_size); memset (buf, 0, xstormy16_reg_size);
memcpy (buf, valbuf, 1); memcpy (buf, valbuf, 1);
regcache_raw_write (regcache, E_1ST_ARG_REGNUM, buf); regcache_raw_write (regcache, E_1ST_ARG_REGNUM, buf);
@ -238,7 +238,7 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch,
int i, j; int i, j;
int typelen, slacklen; int typelen, slacklen;
const gdb_byte *val; const gdb_byte *val;
char buf[xstormy16_pc_size]; gdb_byte buf[xstormy16_pc_size];
/* If struct_return is true, then the struct return address will /* If struct_return is true, then the struct return address will
consume one argument-passing register. */ consume one argument-passing register. */
@ -525,7 +525,7 @@ xstormy16_resolve_jmp_table_entry (struct gdbarch *gdbarch, CORE_ADDR faddr)
if (faddr_sect) if (faddr_sect)
{ {
LONGEST inst, inst2, addr; LONGEST inst, inst2, addr;
char buf[2 * xstormy16_inst_size]; gdb_byte buf[2 * xstormy16_inst_size];
/* Return faddr if it's not pointing into the jump table. */ /* Return faddr if it's not pointing into the jump table. */
if (strcmp (faddr_sect->the_bfd_section->name, ".plt")) if (strcmp (faddr_sect->the_bfd_section->name, ".plt"))
@ -577,7 +577,7 @@ xstormy16_find_jmp_table_entry (struct gdbarch *gdbarch, CORE_ADDR faddr)
for (; addr < endaddr; addr += 2 * xstormy16_inst_size) for (; addr < endaddr; addr += 2 * xstormy16_inst_size)
{ {
LONGEST inst, inst2, faddr2; LONGEST inst, inst2, faddr2;
char buf[2 * xstormy16_inst_size]; gdb_byte buf[2 * xstormy16_inst_size];
if (target_read_memory (addr, buf, sizeof buf)) if (target_read_memory (addr, buf, sizeof buf))
return 0; return 0;