+2005-05-24 Andrew Cagney <cagney@gnu.org>
+
+ * rs6000-tdep.c (ppc_supply_reg, ppc_collect_reg): Use gdb_byte
+ for byte buffers.
+ (rs6000_fetch_pointer_argument): Use get_frame_register_unsigned.
+ (rs6000_software_single_step, sstep_breaks, skip_prologue)
+ (rs6000_push_dummy_call, rs6000_push_dummy_call)
+ (rs6000_push_dummy_call, rs6000_push_dummy_call)
+ (rs6000_register_to_value, e500_pseudo_register_read)
+ (rs6000_store_return_value, e500_pseudo_register_write)
+ (rs6000_frame_prev_register, rs6000_extract_return_value): Ditto.
+ * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
+ (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value)
+ (do_ppc_sysv_return_value, ppc_sysv_abi_return_value)
+ (ppc_sysv_abi_broken_return_value)
+ (ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_push_dummy_call)
+ (ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value)
+ (ppc64_sysv_abi_return_value, ppc64_sysv_abi_return_value): Ditto.
+ * ppc-linux-tdep.c (ppc_linux_in_sigtramp)
+ (ppc_linux_at_sigtramp_return_path)
+ (ppc_linux_skip_trampoline_code)
+ (ppc_linux_memory_remove_breakpoint, ppc_linux_return_value):
+ * rs6000-tdep.c (rs6000_value_to_register)
+ (rs6000_register_to_value): Ditto.
+ * ppc-tdep.h (ppc_sysv_abi_return_value)
+ (ppc64_sysv_abi_return_value, ppc_sysv_abi_broken_return_value)
+ (ppc_linux_memory_remove_breakpoint): Ditto.
+
2005-05-24 Ulrich Weigand <uweigand@de.ibm.com>
* s390-tdep.c (s390_frame_prev_register): Change type of last
CORE_ADDR lr;
CORE_ADDR sp;
CORE_ADDR tramp_sp;
- char buf[4];
+ gdb_byte buf[4];
CORE_ADDR handler;
lr = read_register (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum);
static int
ppc_linux_at_sigtramp_return_path (CORE_ADDR pc)
{
- char buf[12];
+ gdb_byte buf[12];
unsigned long pcinsn;
if (target_read_memory (pc - 4, buf, sizeof (buf)) != 0)
return 0;
static CORE_ADDR
ppc_linux_skip_trampoline_code (CORE_ADDR pc)
{
- char buf[4];
+ gdb_byte buf[4];
struct obj_section *sect;
struct objfile *objfile;
unsigned long insn;
/* Fetch the string; we don't know how long it is. Is it possible
that the following will fail because we're trying to fetch too
much? */
- if (target_read_memory (strtab + symidx, symname, sizeof (symname)) != 0)
+ if (target_read_memory (strtab + symidx, (gdb_byte *) symname,
+ sizeof (symname)) != 0)
return 0;
/* This might not work right if we have multiple symbols with the
regard to removing breakpoints in some potentially self modifying
code. */
int
-ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
+ppc_linux_memory_remove_breakpoint (CORE_ADDR addr,
+ gdb_byte *contents_cache)
{
const unsigned char *bp;
int val;
int bplen;
- char old_contents[BREAKPOINT_MAX];
+ gdb_byte old_contents[BREAKPOINT_MAX];
/* Determine appropriate breakpoint contents and size for this address. */
bp = BREAKPOINT_FROM_PC (&addr, &bplen);
static enum return_value_convention
ppc_linux_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_CODE (valtype) == TYPE_CODE_STRUCT
|| TYPE_CODE (valtype) == TYPE_CODE_UNION)
{
/* Always store the floating point value using
the register's floating-point format. */
- char regval[MAX_REGISTER_SIZE];
+ gdb_byte regval[MAX_REGISTER_SIZE];
struct type *regtype
= register_type (gdbarch, tdep->ppc_fp0_regnum + freg);
convert_typed_floating (val, type, regval, regtype);
{
/* Reduce the parameter down to something that fits in a
"word". */
- char word[MAX_REGISTER_SIZE];
+ gdb_byte word[MAX_REGISTER_SIZE];
memset (word, 0, MAX_REGISTER_SIZE);
if (len > tdep->wordsize
|| TYPE_CODE (type) == TYPE_CODE_STRUCT
{
/* Floats and doubles stored in "f1". Convert the value to
the required type. */
- char regval[MAX_REGISTER_SIZE];
+ gdb_byte regval[MAX_REGISTER_SIZE];
struct type *regtype = register_type (gdbarch,
tdep->ppc_fp0_regnum + 1);
regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, regval);
{
/* Floats and doubles stored in "f1". Convert the value to
the register's "double" type. */
- char regval[MAX_REGISTER_SIZE];
+ gdb_byte regval[MAX_REGISTER_SIZE];
struct type *regtype = register_type (gdbarch, tdep->ppc_fp0_regnum);
convert_typed_floating (writebuf, type, regval, regtype);
regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval);
/* This matches SVr4 PPC, it does not match GCC. */
/* The value is right-padded to 8 bytes and then loaded, as
two "words", into r3/r4. */
- char regvals[MAX_REGISTER_SIZE * 2];
+ gdb_byte regvals[MAX_REGISTER_SIZE * 2];
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3,
regvals + 0 * tdep->wordsize);
if (TYPE_LENGTH (type) > tdep->wordsize)
/* This matches SVr4 PPC, it does not match GCC. */
/* The value is padded out to 8 bytes and then loaded, as
two "words" into r3/r4. */
- char regvals[MAX_REGISTER_SIZE * 2];
+ gdb_byte regvals[MAX_REGISTER_SIZE * 2];
memset (regvals, 0, sizeof regvals);
memcpy (regvals, writebuf, TYPE_LENGTH (type));
regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3,
enum return_value_convention
ppc_sysv_abi_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)
{
return do_ppc_sysv_return_value (gdbarch, valtype, regcache, readbuf,
writebuf, 0);
ppc_sysv_abi_broken_return_value (struct gdbarch *gdbarch,
struct type *valtype,
struct regcache *regcache,
- void *readbuf, const void *writebuf)
+ gdb_byte *readbuf, const gdb_byte *writebuf)
{
return do_ppc_sysv_return_value (gdbarch, valtype, regcache, readbuf,
writebuf, 1);
if (ppc_floating_point_unit_p (current_gdbarch)
&& freg <= 13)
{
- char regval[MAX_REGISTER_SIZE];
+ gdb_byte regval[MAX_REGISTER_SIZE];
struct type *regtype
= register_type (gdbarch, tdep->ppc_fp0_regnum);
convert_typed_floating (val, type, regval, regtype);
This code interprets that to mean: store it,
left aligned, in the general register. */
- char regval[MAX_REGISTER_SIZE];
+ gdb_byte regval[MAX_REGISTER_SIZE];
memset (regval, 0, sizeof regval);
memcpy (regval, val, TYPE_LENGTH (type));
regcache_cooked_write (regcache,
{
if (write_pass && greg <= 10)
{
- char regval[MAX_REGISTER_SIZE];
+ gdb_byte regval[MAX_REGISTER_SIZE];
int len = TYPE_LENGTH (type) - byte;
if (len > tdep->wordsize)
len = tdep->wordsize;
corresponding register return-value location. */
enum return_value_convention
ppc64_sysv_abi_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)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* Floats and doubles in F1. */
if (TYPE_CODE (valtype) == TYPE_CODE_FLT && TYPE_LENGTH (valtype) <= 8)
{
- char regval[MAX_REGISTER_SIZE];
+ gdb_byte regval[MAX_REGISTER_SIZE];
struct type *regtype = register_type (gdbarch, tdep->ppc_fp0_regnum);
if (writebuf != NULL)
{
int i;
for (i = 0; i < 2; i++)
{
- char regval[MAX_REGISTER_SIZE];
+ gdb_byte regval[MAX_REGISTER_SIZE];
struct type *regtype =
register_type (current_gdbarch, tdep->ppc_fp0_regnum);
if (writebuf != NULL)
enum return_value_convention ppc_sysv_abi_return_value (struct gdbarch *gdbarch,
struct type *valtype,
struct regcache *regcache,
- void *readbuf,
- const void *writebuf);
+ gdb_byte *readbuf,
+ const gdb_byte *writebuf);
enum return_value_convention ppc_sysv_abi_broken_return_value (struct gdbarch *gdbarch,
struct type *valtype,
struct regcache *regcache,
- void *readbuf,
- const void *writebuf);
+ gdb_byte *readbuf,
+ const gdb_byte *writebuf);
CORE_ADDR ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
struct value *function,
struct regcache *regcache,
CORE_ADDR struct_addr);
CORE_ADDR ppc64_sysv_abi_adjust_breakpoint_address (struct gdbarch *gdbarch,
CORE_ADDR bpaddr);
-int ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache);
+int ppc_linux_memory_remove_breakpoint (CORE_ADDR addr,
+ gdb_byte *contents_cache);
struct link_map_offsets *ppc_linux_svr4_fetch_link_map_offsets (void);
void ppc_linux_supply_gregset (struct regcache *regcache,
int regnum, const void *gregs, size_t size,
enum return_value_convention ppc64_sysv_abi_return_value (struct gdbarch *gdbarch,
struct type *valtype,
struct regcache *regcache,
- void *readbuf,
- const void *writebuf);
+ gdb_byte *readbuf,
+ const gdb_byte *writebuf);
/* From rs6000-tdep.c... */
int altivec_register_p (int regno);
/* Breakpoint shadows for the single step instructions will be kept here. */
static struct sstep_breaks
- {
- /* Address, or 0 if this is not in use. */
- CORE_ADDR address;
- /* Shadow contents. */
- char data[4];
- }
+{
+ /* Address, or 0 if this is not in use. */
+ CORE_ADDR address;
+ /* Shadow contents. */
+ gdb_byte data[4];
+}
stepBreaks[2];
/* Hook for determining the TOC address when calling functions in the
static void
ppc_supply_reg (struct regcache *regcache, int regnum,
- const char *regs, size_t offset)
+ const gdb_byte *regs, size_t offset)
{
if (regnum != -1 && offset != -1)
regcache_raw_supply (regcache, regnum, regs + offset);
static void
ppc_collect_reg (const struct regcache *regcache, int regnum,
- char *regs, size_t offset)
+ gdb_byte *regs, size_t offset)
{
if (regnum != -1 && offset != -1)
regcache_raw_collect (regcache, regnum, regs + offset);
rs6000_fetch_pointer_argument (struct frame_info *frame, int argi,
struct type *type)
{
- CORE_ADDR addr;
- get_frame_register (frame, 3 + argi, &addr);
- return addr;
+ return get_frame_register_unsigned (frame, 3 + argi);
}
/* Calculate the destination of a branch/jump. Return -1 if not a branch. */
{
CORE_ADDR dummy;
int breakp_sz;
- const char *breakp = rs6000_breakpoint_from_pc (&dummy, &breakp_sz);
+ const gdb_byte *breakp = rs6000_breakpoint_from_pc (&dummy, &breakp_sz);
int ii, insn;
CORE_ADDR loc;
CORE_ADDR breaks[2];
CORE_ADDR orig_pc = pc;
CORE_ADDR last_prologue_pc = pc;
CORE_ADDR li_found_pc = 0;
- char buf[4];
+ gdb_byte buf[4];
unsigned long op;
long offset = 0;
long vr_saved_offset = 0;
int len = 0;
int argno; /* current argument number */
int argbytes; /* current argument byte */
- char tmp_buffer[50];
+ gdb_byte tmp_buffer[50];
int f_argno = 0; /* current floating point argno */
int wordsize = gdbarch_tdep (current_gdbarch)->wordsize;
CORE_ADDR func_addr = find_function_addr (function, NULL);
/* Argument takes more than one register. */
while (argbytes < len)
{
- char word[MAX_REGISTER_SIZE];
+ gdb_byte word[MAX_REGISTER_SIZE];
memset (word, 0, reg_size);
memcpy (word,
((char *) value_contents (arg)) + argbytes,
{
/* Argument can fit in one register. No problem. */
int adj = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? reg_size - len : 0;
- char word[MAX_REGISTER_SIZE];
+ gdb_byte word[MAX_REGISTER_SIZE];
memset (word, 0, reg_size);
memcpy (word, value_contents (arg), len);
if (argbytes)
{
write_memory (sp + 24 + (ii * 4),
- ((char *) value_contents (arg)) + argbytes,
+ value_contents (arg) + argbytes,
len - argbytes);
++argno;
ii += ((len - argbytes + 3) & -4) / 4;
++f_argno;
}
- write_memory (sp + 24 + (ii * 4),
- (char *) value_contents (arg),
- len);
+ write_memory (sp + 24 + (ii * 4), value_contents (arg), len);
ii += ((len + 3) & -4) / 4;
}
}
}
static void
-rs6000_extract_return_value (struct type *valtype, bfd_byte *regbuf,
- bfd_byte *valbuf)
+rs6000_extract_return_value (struct type *valtype, gdb_byte *regbuf,
+ gdb_byte *valbuf)
{
int offset = 0;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
rs6000_register_to_value (struct frame_info *frame,
int regnum,
struct type *type,
- void *to)
+ gdb_byte *to)
{
const struct reg *reg = gdbarch_tdep (current_gdbarch)->regs + regnum;
- char from[MAX_REGISTER_SIZE];
+ gdb_byte from[MAX_REGISTER_SIZE];
gdb_assert (reg->fpr);
gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
rs6000_value_to_register (struct frame_info *frame,
int regnum,
struct type *type,
- const void *from)
+ const gdb_byte *from)
{
const struct reg *reg = gdbarch_tdep (current_gdbarch)->regs + regnum;
- char to[MAX_REGISTER_SIZE];
+ gdb_byte to[MAX_REGISTER_SIZE];
gdb_assert (reg->fpr);
gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
co-variant type qualifiers, ... */
static void
e500_move_ev_register (void (*move) (struct regcache *regcache,
- int regnum, void *buf),
+ int regnum, gdb_byte *buf),
struct regcache *regcache, int ev_reg,
- void *buffer)
+ gdb_byte *buffer)
{
struct gdbarch *arch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (arch);
int reg_index;
- char *byte_buffer = buffer;
+ gdb_byte *byte_buffer = buffer;
gdb_assert (tdep->ppc_ev0_regnum <= ev_reg
&& ev_reg < tdep->ppc_ev0_regnum + ppc_num_gprs);
static void
e500_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
- int reg_nr, void *buffer)
+ int reg_nr, gdb_byte *buffer)
{
struct gdbarch *regcache_arch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
static void
e500_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
- int reg_nr, const void *buffer)
+ int reg_nr, const gdb_byte *buffer)
{
struct gdbarch *regcache_arch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (tdep->ppc_ev0_regnum <= reg_nr
&& reg_nr < tdep->ppc_ev0_regnum + ppc_num_gprs)
- e500_move_ev_register ((void (*) (struct regcache *, int, void *))
+ e500_move_ev_register ((void (*) (struct regcache *, int, gdb_byte *))
regcache_raw_write,
- regcache, reg_nr, (void *) buffer);
+ regcache, reg_nr, (gdb_byte *) buffer);
else
internal_error (__FILE__, __LINE__,
_("e500_pseudo_register_read: "
static void
rs6000_store_return_value (struct type *type,
struct regcache *regcache,
- const void *valbuf)
+ const gdb_byte *valbuf)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
register_size (gdbarch, regnum));
regcache_cooked_write_part (regcache, regnum,
0, bytes_to_write,
- (char *) valbuf + bytes_written);
+ valbuf + bytes_written);
regnum++;
bytes_written += bytes_to_write;
}
void **this_cache,
int regnum, int *optimizedp,
enum lval_type *lvalp, CORE_ADDR *addrp,
- int *realnump, void *valuep)
+ int *realnump, gdb_byte *valuep)
{
struct rs6000_frame_cache *info = rs6000_frame_cache (next_frame,
this_cache);