mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-02 20:53:06 +08:00
Change some void* to gdb_byte*
There are a bunch of places where a void* is implicitely casted into a gdb_byte*. The auto-insert-casts script added explicit casts at those places. However, in many cases, it makes more sense to just change the void* to a gdb_byte*. gdb/ChangeLog: * aarch64-tdep.c (stack_item_t): Change type of data to gdb_byte*. * arm-tdep.c (struct stack_item): Likewise. (push_stack_item): Add gdb_byte* cast. * avr-tdep.c (struct stack_item): Change type of data to gdb_byte*. (push_stack_item): Add gdb_byte* cast. * cli/cli-dump.c (dump_memory_to_file): Change type of buf to gdb_byte* and add cast. * cris-tdep.c (struct stack_item): Change type of data to gdb_byte*. (push_stack_item): Add gdb_byte* cast. * gcore.c (gcore_copy_callback): Change type of memhunk to gdb_byte* and add cast. * gdbtypes.h (print_scalar_formatted): Change type of first parameter to gdb_byte*. * h8300-tdep.c (h8300_extract_return_value): Change type of valbuf to gdb_byte* and remove unnecessary cast. (h8300h_extract_return_value): Likewise. (h8300_store_return_value): Change type of valbuf to gdb_byte*. (h8300h_store_return_value): Likewise. * iq2000-tdep.c (iq2000_extract_return_value): Change type of valbuf to gdb_byte* and remove unnecessary cast. * jit.c (jit_reader_try_read_symtab): Change type of gdb_mem to gdb_byte* and add cast. * m32r-tdep.c (m32r_store_return_value): Change type of valbuf to gdb_byte* and remove unnecessary cast. (m32r_extract_return_value): Change type of dst to gdb_byte* and remove valbuf. * mep-tdep.c (mep_pseudo_cr32_read): Change type of buf to gdb_byte*. (mep_pseudo_cr64_read): Likewise. (mep_pseudo_csr_write): Likewise. (mep_pseudo_cr32_write): Likewise. (mep_pseudo_cr64_write): Likewise. * mi/mi-main.c (mi_cmd_data_write_memory): Change type of buffer to gdb_byte* and add cast. * moxie-tdep.c (moxie_store_return_value): Change type of valbuf to gdb_byte* and remove unnecessary cast. (moxie_extract_return_value): Change type of dst to gdb_byte* and remove valbuf. * p-valprint.c (print_scalar_formatted): Change type of valaddr to gdb_byte*. * printcmd.c (void): Likewise. * python/py-inferior.c (infpy_read_memory): Change type of buffer to gdb_byte* and add cast. (infpy_write_memory): Likewise. (infpy_search_memory): Likewise. * regcache.c (regcache_raw_write_signed): Change type of buf to gdb_byte* and add cast. (regcache_raw_write_unsigned): Likewise. (regcache_cooked_write_signed): Likewise. (regcache_cooked_write_unsigned): Likewise. * sh64-tdep.c (h64_extract_return_value): Change type of valbuf to gdb_byte*.
This commit is contained in:
@ -1,3 +1,57 @@
|
|||||||
|
2015-10-09 Simon Marchi <simon.marchi@ericsson.com>
|
||||||
|
|
||||||
|
* aarch64-tdep.c (stack_item_t): Change type of data to gdb_byte*.
|
||||||
|
* arm-tdep.c (struct stack_item): Likewise.
|
||||||
|
(push_stack_item): Add gdb_byte* cast.
|
||||||
|
* avr-tdep.c (struct stack_item): Change type of data to gdb_byte*.
|
||||||
|
(push_stack_item): Add gdb_byte* cast.
|
||||||
|
* cli/cli-dump.c (dump_memory_to_file): Change type of buf to gdb_byte*
|
||||||
|
and add cast.
|
||||||
|
* cris-tdep.c (struct stack_item): Change type of data to gdb_byte*.
|
||||||
|
(push_stack_item): Add gdb_byte* cast.
|
||||||
|
* gcore.c (gcore_copy_callback): Change type of memhunk to gdb_byte* and
|
||||||
|
add cast.
|
||||||
|
* gdbtypes.h (print_scalar_formatted): Change type of first parameter to
|
||||||
|
gdb_byte*.
|
||||||
|
* h8300-tdep.c (h8300_extract_return_value): Change type of valbuf to
|
||||||
|
gdb_byte* and remove unnecessary cast.
|
||||||
|
(h8300h_extract_return_value): Likewise.
|
||||||
|
(h8300_store_return_value): Change type of valbuf to gdb_byte*.
|
||||||
|
(h8300h_store_return_value): Likewise.
|
||||||
|
* iq2000-tdep.c (iq2000_extract_return_value): Change type of valbuf to
|
||||||
|
gdb_byte* and remove unnecessary cast.
|
||||||
|
* jit.c (jit_reader_try_read_symtab): Change type of gdb_mem to gdb_byte*
|
||||||
|
and add cast.
|
||||||
|
* m32r-tdep.c (m32r_store_return_value): Change type of valbuf to
|
||||||
|
gdb_byte* and remove unnecessary cast.
|
||||||
|
(m32r_extract_return_value): Change type of dst to gdb_byte* and remove
|
||||||
|
valbuf.
|
||||||
|
* mep-tdep.c (mep_pseudo_cr32_read): Change type of buf to gdb_byte*.
|
||||||
|
(mep_pseudo_cr64_read): Likewise.
|
||||||
|
(mep_pseudo_csr_write): Likewise.
|
||||||
|
(mep_pseudo_cr32_write): Likewise.
|
||||||
|
(mep_pseudo_cr64_write): Likewise.
|
||||||
|
* mi/mi-main.c (mi_cmd_data_write_memory): Change type of buffer to
|
||||||
|
gdb_byte* and add cast.
|
||||||
|
* moxie-tdep.c (moxie_store_return_value): Change type of valbuf to
|
||||||
|
gdb_byte* and remove unnecessary cast.
|
||||||
|
(moxie_extract_return_value): Change type of dst to gdb_byte* and remove
|
||||||
|
valbuf.
|
||||||
|
* p-valprint.c (print_scalar_formatted): Change type of valaddr to
|
||||||
|
gdb_byte*.
|
||||||
|
* printcmd.c (void): Likewise.
|
||||||
|
* python/py-inferior.c (infpy_read_memory): Change type of buffer to
|
||||||
|
gdb_byte* and add cast.
|
||||||
|
(infpy_write_memory): Likewise.
|
||||||
|
(infpy_search_memory): Likewise.
|
||||||
|
* regcache.c (regcache_raw_write_signed): Change type of buf to gdb_byte*
|
||||||
|
and add cast.
|
||||||
|
(regcache_raw_write_unsigned): Likewise.
|
||||||
|
(regcache_cooked_write_signed): Likewise.
|
||||||
|
(regcache_cooked_write_unsigned): Likewise.
|
||||||
|
* sh64-tdep.c (h64_extract_return_value): Change type of valbuf to
|
||||||
|
gdb_byte*.
|
||||||
|
|
||||||
2015-10-09 Simon Marchi <simon.marchi@ericsson.com>
|
2015-10-09 Simon Marchi <simon.marchi@ericsson.com>
|
||||||
|
|
||||||
* fbsd-tdep.c (fbsd_collect_regset_section_cb): Add cast.
|
* fbsd-tdep.c (fbsd_collect_regset_section_cb): Add cast.
|
||||||
|
@ -1161,7 +1161,7 @@ aarch64_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
/* Value to pass on stack. */
|
/* Value to pass on stack. */
|
||||||
const void *data;
|
const gdb_byte *data;
|
||||||
|
|
||||||
/* Size in bytes of value to pass on stack. */
|
/* Size in bytes of value to pass on stack. */
|
||||||
int len;
|
int len;
|
||||||
|
@ -3398,7 +3398,7 @@ struct stack_item
|
|||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
struct stack_item *prev;
|
struct stack_item *prev;
|
||||||
void *data;
|
gdb_byte *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct stack_item *
|
static struct stack_item *
|
||||||
@ -3406,7 +3406,7 @@ push_stack_item (struct stack_item *prev, const void *contents, int len)
|
|||||||
{
|
{
|
||||||
struct stack_item *si;
|
struct stack_item *si;
|
||||||
si = XNEW (struct stack_item);
|
si = XNEW (struct stack_item);
|
||||||
si->data = xmalloc (len);
|
si->data = (gdb_byte *) xmalloc (len);
|
||||||
si->len = len;
|
si->len = len;
|
||||||
si->prev = prev;
|
si->prev = prev;
|
||||||
memcpy (si->data, contents, len);
|
memcpy (si->data, contents, len);
|
||||||
|
@ -1198,7 +1198,7 @@ struct stack_item
|
|||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
struct stack_item *prev;
|
struct stack_item *prev;
|
||||||
void *data;
|
gdb_byte *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct stack_item *
|
static struct stack_item *
|
||||||
@ -1206,7 +1206,7 @@ push_stack_item (struct stack_item *prev, const bfd_byte *contents, int len)
|
|||||||
{
|
{
|
||||||
struct stack_item *si;
|
struct stack_item *si;
|
||||||
si = XNEW (struct stack_item);
|
si = XNEW (struct stack_item);
|
||||||
si->data = xmalloc (len);
|
si->data = (gdb_byte *) xmalloc (len);
|
||||||
si->len = len;
|
si->len = len;
|
||||||
si->prev = prev;
|
si->prev = prev;
|
||||||
memcpy (si->data, contents, len);
|
memcpy (si->data, contents, len);
|
||||||
|
@ -212,7 +212,7 @@ dump_memory_to_file (const char *cmd, const char *mode, const char *file_format)
|
|||||||
CORE_ADDR hi;
|
CORE_ADDR hi;
|
||||||
ULONGEST count;
|
ULONGEST count;
|
||||||
const char *filename;
|
const char *filename;
|
||||||
void *buf;
|
gdb_byte *buf;
|
||||||
const char *lo_exp;
|
const char *lo_exp;
|
||||||
const char *hi_exp;
|
const char *hi_exp;
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ dump_memory_to_file (const char *cmd, const char *mode, const char *file_format)
|
|||||||
|
|
||||||
/* FIXME: Should use read_memory_partial() and a magic blocking
|
/* FIXME: Should use read_memory_partial() and a magic blocking
|
||||||
value. */
|
value. */
|
||||||
buf = xmalloc (count);
|
buf = (gdb_byte *) xmalloc (count);
|
||||||
make_cleanup (xfree, buf);
|
make_cleanup (xfree, buf);
|
||||||
read_memory (lo, buf, count);
|
read_memory (lo, buf, count);
|
||||||
|
|
||||||
|
@ -665,14 +665,14 @@ struct stack_item
|
|||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
struct stack_item *prev;
|
struct stack_item *prev;
|
||||||
void *data;
|
gdb_byte *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct stack_item *
|
static struct stack_item *
|
||||||
push_stack_item (struct stack_item *prev, const gdb_byte *contents, int len)
|
push_stack_item (struct stack_item *prev, const gdb_byte *contents, int len)
|
||||||
{
|
{
|
||||||
struct stack_item *si = XNEW (struct stack_item);
|
struct stack_item *si = XNEW (struct stack_item);
|
||||||
si->data = xmalloc (len);
|
si->data = (gdb_byte *) xmalloc (len);
|
||||||
si->len = len;
|
si->len = len;
|
||||||
si->prev = prev;
|
si->prev = prev;
|
||||||
memcpy (si->data, contents, len);
|
memcpy (si->data, contents, len);
|
||||||
|
@ -562,7 +562,7 @@ gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
|
|||||||
bfd_size_type size, total_size = bfd_section_size (obfd, osec);
|
bfd_size_type size, total_size = bfd_section_size (obfd, osec);
|
||||||
file_ptr offset = 0;
|
file_ptr offset = 0;
|
||||||
struct cleanup *old_chain = NULL;
|
struct cleanup *old_chain = NULL;
|
||||||
void *memhunk;
|
gdb_byte *memhunk;
|
||||||
|
|
||||||
/* Read-only sections are marked; we don't have to copy their contents. */
|
/* Read-only sections are marked; we don't have to copy their contents. */
|
||||||
if ((bfd_get_section_flags (obfd, osec) & SEC_LOAD) == 0)
|
if ((bfd_get_section_flags (obfd, osec) & SEC_LOAD) == 0)
|
||||||
@ -573,7 +573,7 @@ gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
size = min (total_size, MAX_COPY_BYTES);
|
size = min (total_size, MAX_COPY_BYTES);
|
||||||
memhunk = xmalloc (size);
|
memhunk = (gdb_byte *) xmalloc (size);
|
||||||
old_chain = make_cleanup (xfree, memhunk);
|
old_chain = make_cleanup (xfree, memhunk);
|
||||||
|
|
||||||
while (total_size > 0)
|
while (total_size > 0)
|
||||||
|
@ -1904,7 +1904,7 @@ extern int field_is_static (struct field *);
|
|||||||
|
|
||||||
/* printcmd.c */
|
/* printcmd.c */
|
||||||
|
|
||||||
extern void print_scalar_formatted (const void *, struct type *,
|
extern void print_scalar_formatted (const gdb_byte *, struct type *,
|
||||||
const struct value_print_options *,
|
const struct value_print_options *,
|
||||||
int, struct ui_file *);
|
int, struct ui_file *);
|
||||||
|
|
||||||
|
@ -742,7 +742,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
h8300_extract_return_value (struct type *type, struct regcache *regcache,
|
h8300_extract_return_value (struct type *type, struct regcache *regcache,
|
||||||
void *valbuf)
|
gdb_byte *valbuf)
|
||||||
{
|
{
|
||||||
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);
|
||||||
@ -760,7 +760,7 @@ h8300_extract_return_value (struct type *type, struct regcache *regcache,
|
|||||||
regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c);
|
regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c);
|
||||||
store_unsigned_integer (valbuf, 2, byte_order, c);
|
store_unsigned_integer (valbuf, 2, byte_order, c);
|
||||||
regcache_cooked_read_unsigned (regcache, E_RET1_REGNUM, &c);
|
regcache_cooked_read_unsigned (regcache, E_RET1_REGNUM, &c);
|
||||||
store_unsigned_integer ((void *)((char *) valbuf + 2), 2, byte_order, c);
|
store_unsigned_integer (valbuf + 2, 2, byte_order, c);
|
||||||
break;
|
break;
|
||||||
case 8: /* long long is now 8 bytes. */
|
case 8: /* long long is now 8 bytes. */
|
||||||
if (TYPE_CODE (type) == TYPE_CODE_INT)
|
if (TYPE_CODE (type) == TYPE_CODE_INT)
|
||||||
@ -779,7 +779,7 @@ h8300_extract_return_value (struct type *type, struct regcache *regcache,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
h8300h_extract_return_value (struct type *type, struct regcache *regcache,
|
h8300h_extract_return_value (struct type *type, struct regcache *regcache,
|
||||||
void *valbuf)
|
gdb_byte *valbuf)
|
||||||
{
|
{
|
||||||
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);
|
||||||
@ -799,8 +799,7 @@ h8300h_extract_return_value (struct type *type, struct regcache *regcache,
|
|||||||
regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c);
|
regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c);
|
||||||
store_unsigned_integer (valbuf, 4, byte_order, c);
|
store_unsigned_integer (valbuf, 4, byte_order, c);
|
||||||
regcache_cooked_read_unsigned (regcache, E_RET1_REGNUM, &c);
|
regcache_cooked_read_unsigned (regcache, E_RET1_REGNUM, &c);
|
||||||
store_unsigned_integer ((void *) ((char *) valbuf + 4), 4,
|
store_unsigned_integer (valbuf + 4, 4, byte_order, c);
|
||||||
byte_order, c);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -845,7 +844,7 @@ h8300h_use_struct_convention (struct type *value_type)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
h8300_store_return_value (struct type *type, struct regcache *regcache,
|
h8300_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 *gdbarch = get_regcache_arch (regcache);
|
||||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||||
@ -874,7 +873,7 @@ h8300_store_return_value (struct type *type, struct regcache *regcache,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
h8300h_store_return_value (struct type *type, struct regcache *regcache,
|
h8300h_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 *gdbarch = get_regcache_arch (regcache);
|
||||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||||
|
@ -537,7 +537,7 @@ iq2000_use_struct_convention (struct type *type)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
iq2000_extract_return_value (struct type *type, struct regcache *regcache,
|
iq2000_extract_return_value (struct type *type, struct regcache *regcache,
|
||||||
void *valbuf)
|
gdb_byte *valbuf)
|
||||||
{
|
{
|
||||||
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);
|
||||||
@ -564,7 +564,7 @@ iq2000_extract_return_value (struct type *type, struct regcache *regcache,
|
|||||||
regcache_cooked_read_unsigned (regcache, regno++, &tmp);
|
regcache_cooked_read_unsigned (regcache, regno++, &tmp);
|
||||||
store_unsigned_integer (valbuf, size, byte_order, tmp);
|
store_unsigned_integer (valbuf, size, byte_order, tmp);
|
||||||
len -= size;
|
len -= size;
|
||||||
valbuf = ((char *) valbuf) + size;
|
valbuf += size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -819,7 +819,7 @@ static int
|
|||||||
jit_reader_try_read_symtab (struct jit_code_entry *code_entry,
|
jit_reader_try_read_symtab (struct jit_code_entry *code_entry,
|
||||||
CORE_ADDR entry_addr)
|
CORE_ADDR entry_addr)
|
||||||
{
|
{
|
||||||
void *gdb_mem;
|
gdb_byte *gdb_mem;
|
||||||
int status;
|
int status;
|
||||||
jit_dbg_reader_data priv_data;
|
jit_dbg_reader_data priv_data;
|
||||||
struct gdb_reader_funcs *funcs;
|
struct gdb_reader_funcs *funcs;
|
||||||
@ -842,7 +842,7 @@ jit_reader_try_read_symtab (struct jit_code_entry *code_entry,
|
|||||||
if (!loaded_jit_reader)
|
if (!loaded_jit_reader)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
gdb_mem = xmalloc (code_entry->symfile_size);
|
gdb_mem = (gdb_byte *) xmalloc (code_entry->symfile_size);
|
||||||
|
|
||||||
status = 1;
|
status = 1;
|
||||||
TRY
|
TRY
|
||||||
|
@ -249,7 +249,7 @@ m32r_register_type (struct gdbarch *gdbarch, int reg_nr)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
m32r_store_return_value (struct type *type, struct regcache *regcache,
|
m32r_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 *gdbarch = get_regcache_arch (regcache);
|
||||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||||
@ -261,7 +261,7 @@ m32r_store_return_value (struct type *type, struct regcache *regcache,
|
|||||||
|
|
||||||
if (len > 4)
|
if (len > 4)
|
||||||
{
|
{
|
||||||
regval = extract_unsigned_integer ((gdb_byte *) valbuf + 4,
|
regval = extract_unsigned_integer (valbuf + 4,
|
||||||
len - 4, byte_order);
|
len - 4, byte_order);
|
||||||
regcache_cooked_write_unsigned (regcache, RET1_REGNUM + 1, regval);
|
regcache_cooked_write_unsigned (regcache, RET1_REGNUM + 1, regval);
|
||||||
}
|
}
|
||||||
@ -776,25 +776,24 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
m32r_extract_return_value (struct type *type, struct regcache *regcache,
|
m32r_extract_return_value (struct type *type, struct regcache *regcache,
|
||||||
void *dst)
|
gdb_byte *dst)
|
||||||
{
|
{
|
||||||
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);
|
||||||
bfd_byte *valbuf = dst;
|
|
||||||
int len = TYPE_LENGTH (type);
|
int len = TYPE_LENGTH (type);
|
||||||
ULONGEST tmp;
|
ULONGEST tmp;
|
||||||
|
|
||||||
/* By using store_unsigned_integer we avoid having to do
|
/* By using store_unsigned_integer we avoid having to do
|
||||||
anything special for small big-endian values. */
|
anything special for small big-endian values. */
|
||||||
regcache_cooked_read_unsigned (regcache, RET1_REGNUM, &tmp);
|
regcache_cooked_read_unsigned (regcache, RET1_REGNUM, &tmp);
|
||||||
store_unsigned_integer (valbuf, (len > 4 ? len - 4 : len), byte_order, tmp);
|
store_unsigned_integer (dst, (len > 4 ? len - 4 : len), byte_order, tmp);
|
||||||
|
|
||||||
/* Ignore return values more than 8 bytes in size because the m32r
|
/* Ignore return values more than 8 bytes in size because the m32r
|
||||||
returns anything more than 8 bytes in the stack. */
|
returns anything more than 8 bytes in the stack. */
|
||||||
if (len > 4)
|
if (len > 4)
|
||||||
{
|
{
|
||||||
regcache_cooked_read_unsigned (regcache, RET1_REGNUM + 1, &tmp);
|
regcache_cooked_read_unsigned (regcache, RET1_REGNUM + 1, &tmp);
|
||||||
store_unsigned_integer (valbuf + len - 4, 4, byte_order, tmp);
|
store_unsigned_integer (dst + len - 4, 4, byte_order, tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1126,7 +1126,7 @@ static enum register_status
|
|||||||
mep_pseudo_cr32_read (struct gdbarch *gdbarch,
|
mep_pseudo_cr32_read (struct gdbarch *gdbarch,
|
||||||
struct regcache *regcache,
|
struct regcache *regcache,
|
||||||
int cookednum,
|
int cookednum,
|
||||||
void *buf)
|
gdb_byte *buf)
|
||||||
{
|
{
|
||||||
enum register_status status;
|
enum register_status status;
|
||||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||||
@ -1152,7 +1152,7 @@ static enum register_status
|
|||||||
mep_pseudo_cr64_read (struct gdbarch *gdbarch,
|
mep_pseudo_cr64_read (struct gdbarch *gdbarch,
|
||||||
struct regcache *regcache,
|
struct regcache *regcache,
|
||||||
int cookednum,
|
int cookednum,
|
||||||
void *buf)
|
gdb_byte *buf)
|
||||||
{
|
{
|
||||||
return regcache_raw_read (regcache, mep_pseudo_to_raw[cookednum], buf);
|
return regcache_raw_read (regcache, mep_pseudo_to_raw[cookednum], buf);
|
||||||
}
|
}
|
||||||
@ -1182,7 +1182,7 @@ static void
|
|||||||
mep_pseudo_csr_write (struct gdbarch *gdbarch,
|
mep_pseudo_csr_write (struct gdbarch *gdbarch,
|
||||||
struct regcache *regcache,
|
struct regcache *regcache,
|
||||||
int cookednum,
|
int cookednum,
|
||||||
const void *buf)
|
const gdb_byte *buf)
|
||||||
{
|
{
|
||||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||||
int size = register_size (gdbarch, cookednum);
|
int size = register_size (gdbarch, cookednum);
|
||||||
@ -1213,7 +1213,7 @@ static void
|
|||||||
mep_pseudo_cr32_write (struct gdbarch *gdbarch,
|
mep_pseudo_cr32_write (struct gdbarch *gdbarch,
|
||||||
struct regcache *regcache,
|
struct regcache *regcache,
|
||||||
int cookednum,
|
int cookednum,
|
||||||
const void *buf)
|
const gdb_byte *buf)
|
||||||
{
|
{
|
||||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
enum bfd_endian byte_order = gdbarch_byte_order (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
|
||||||
@ -1234,7 +1234,7 @@ static void
|
|||||||
mep_pseudo_cr64_write (struct gdbarch *gdbarch,
|
mep_pseudo_cr64_write (struct gdbarch *gdbarch,
|
||||||
struct regcache *regcache,
|
struct regcache *regcache,
|
||||||
int cookednum,
|
int cookednum,
|
||||||
const void *buf)
|
const gdb_byte *buf)
|
||||||
{
|
{
|
||||||
regcache_raw_write (regcache, mep_pseudo_to_raw[cookednum], buf);
|
regcache_raw_write (regcache, mep_pseudo_to_raw[cookednum], buf);
|
||||||
}
|
}
|
||||||
|
@ -1696,7 +1696,7 @@ mi_cmd_data_write_memory (char *command, char **argv, int argc)
|
|||||||
/* FIXME: ezannoni 2000-02-17 LONGEST could possibly not be big
|
/* FIXME: ezannoni 2000-02-17 LONGEST could possibly not be big
|
||||||
enough when using a compiler other than GCC. */
|
enough when using a compiler other than GCC. */
|
||||||
LONGEST value;
|
LONGEST value;
|
||||||
void *buffer;
|
gdb_byte *buffer;
|
||||||
struct cleanup *old_chain;
|
struct cleanup *old_chain;
|
||||||
long offset = 0;
|
long offset = 0;
|
||||||
int oind = 0;
|
int oind = 0;
|
||||||
@ -1744,7 +1744,7 @@ mi_cmd_data_write_memory (char *command, char **argv, int argc)
|
|||||||
/* Get the value as a number. */
|
/* Get the value as a number. */
|
||||||
value = parse_and_eval_address (argv[3]);
|
value = parse_and_eval_address (argv[3]);
|
||||||
/* Get the value into an array. */
|
/* Get the value into an array. */
|
||||||
buffer = xmalloc (word_size);
|
buffer = (gdb_byte *) xmalloc (word_size);
|
||||||
old_chain = make_cleanup (xfree, buffer);
|
old_chain = make_cleanup (xfree, buffer);
|
||||||
store_signed_integer (buffer, word_size, byte_order, value);
|
store_signed_integer (buffer, word_size, byte_order, value);
|
||||||
/* Write it down to memory. */
|
/* Write it down to memory. */
|
||||||
|
@ -117,7 +117,7 @@ moxie_register_type (struct gdbarch *gdbarch, int reg_nr)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
moxie_store_return_value (struct type *type, struct regcache *regcache,
|
moxie_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 *gdbarch = get_regcache_arch (regcache);
|
||||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||||
@ -129,8 +129,7 @@ moxie_store_return_value (struct type *type, struct regcache *regcache,
|
|||||||
regcache_cooked_write_unsigned (regcache, RET1_REGNUM, regval);
|
regcache_cooked_write_unsigned (regcache, RET1_REGNUM, regval);
|
||||||
if (len > 4)
|
if (len > 4)
|
||||||
{
|
{
|
||||||
regval = extract_unsigned_integer ((gdb_byte *) valbuf + 4,
|
regval = extract_unsigned_integer (valbuf + 4, len - 4, byte_order);
|
||||||
len - 4, byte_order);
|
|
||||||
regcache_cooked_write_unsigned (regcache, RET1_REGNUM + 1, regval);
|
regcache_cooked_write_unsigned (regcache, RET1_REGNUM + 1, regval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -499,25 +498,24 @@ moxie_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
moxie_extract_return_value (struct type *type, struct regcache *regcache,
|
moxie_extract_return_value (struct type *type, struct regcache *regcache,
|
||||||
void *dst)
|
gdb_byte *dst)
|
||||||
{
|
{
|
||||||
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);
|
||||||
bfd_byte *valbuf = dst;
|
|
||||||
int len = TYPE_LENGTH (type);
|
int len = TYPE_LENGTH (type);
|
||||||
ULONGEST tmp;
|
ULONGEST tmp;
|
||||||
|
|
||||||
/* By using store_unsigned_integer we avoid having to do
|
/* By using store_unsigned_integer we avoid having to do
|
||||||
anything special for small big-endian values. */
|
anything special for small big-endian values. */
|
||||||
regcache_cooked_read_unsigned (regcache, RET1_REGNUM, &tmp);
|
regcache_cooked_read_unsigned (regcache, RET1_REGNUM, &tmp);
|
||||||
store_unsigned_integer (valbuf, (len > 4 ? len - 4 : len), byte_order, tmp);
|
store_unsigned_integer (dst, (len > 4 ? len - 4 : len), byte_order, tmp);
|
||||||
|
|
||||||
/* Ignore return values more than 8 bytes in size because the moxie
|
/* Ignore return values more than 8 bytes in size because the moxie
|
||||||
returns anything more than 8 bytes in the stack. */
|
returns anything more than 8 bytes in the stack. */
|
||||||
if (len > 4)
|
if (len > 4)
|
||||||
{
|
{
|
||||||
regcache_cooked_read_unsigned (regcache, RET1_REGNUM + 1, &tmp);
|
regcache_cooked_read_unsigned (regcache, RET1_REGNUM + 1, &tmp);
|
||||||
store_unsigned_integer (valbuf + len - 4, 4, byte_order, tmp);
|
store_unsigned_integer (dst + len - 4, 4, byte_order, tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,11 +203,11 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
|
|||||||
&& addr != 0)
|
&& addr != 0)
|
||||||
{
|
{
|
||||||
ULONGEST string_length;
|
ULONGEST string_length;
|
||||||
void *buffer;
|
gdb_byte *buffer;
|
||||||
|
|
||||||
if (want_space)
|
if (want_space)
|
||||||
fputs_filtered (" ", stream);
|
fputs_filtered (" ", stream);
|
||||||
buffer = xmalloc (length_size);
|
buffer = (gdb_byte *) xmalloc (length_size);
|
||||||
read_memory (addr + length_pos, buffer, length_size);
|
read_memory (addr + length_pos, buffer, length_size);
|
||||||
string_length = extract_unsigned_integer (buffer, length_size,
|
string_length = extract_unsigned_integer (buffer, length_size,
|
||||||
byte_order);
|
byte_order);
|
||||||
|
@ -346,7 +346,7 @@ float_type_from_length (struct type *type)
|
|||||||
supported at this level. */
|
supported at this level. */
|
||||||
|
|
||||||
void
|
void
|
||||||
print_scalar_formatted (const void *valaddr, struct type *type,
|
print_scalar_formatted (const gdb_byte *valaddr, struct type *type,
|
||||||
const struct value_print_options *options,
|
const struct value_print_options *options,
|
||||||
int size, struct ui_file *stream)
|
int size, struct ui_file *stream)
|
||||||
{
|
{
|
||||||
|
@ -505,7 +505,7 @@ static PyObject *
|
|||||||
infpy_read_memory (PyObject *self, PyObject *args, PyObject *kw)
|
infpy_read_memory (PyObject *self, PyObject *args, PyObject *kw)
|
||||||
{
|
{
|
||||||
CORE_ADDR addr, length;
|
CORE_ADDR addr, length;
|
||||||
void *buffer = NULL;
|
gdb_byte *buffer = NULL;
|
||||||
membuf_object *membuf_obj;
|
membuf_object *membuf_obj;
|
||||||
PyObject *addr_obj, *length_obj, *result;
|
PyObject *addr_obj, *length_obj, *result;
|
||||||
static char *keywords[] = { "address", "length", NULL };
|
static char *keywords[] = { "address", "length", NULL };
|
||||||
@ -520,7 +520,7 @@ infpy_read_memory (PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
|
|
||||||
TRY
|
TRY
|
||||||
{
|
{
|
||||||
buffer = xmalloc (length);
|
buffer = (gdb_byte *) xmalloc (length);
|
||||||
|
|
||||||
read_memory (addr, buffer, length);
|
read_memory (addr, buffer, length);
|
||||||
}
|
}
|
||||||
@ -564,7 +564,7 @@ infpy_write_memory (PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
{
|
{
|
||||||
struct gdb_exception except = exception_none;
|
struct gdb_exception except = exception_none;
|
||||||
Py_ssize_t buf_len;
|
Py_ssize_t buf_len;
|
||||||
const char *buffer;
|
const gdb_byte *buffer;
|
||||||
CORE_ADDR addr, length;
|
CORE_ADDR addr, length;
|
||||||
PyObject *addr_obj, *length_obj = NULL;
|
PyObject *addr_obj, *length_obj = NULL;
|
||||||
static char *keywords[] = { "address", "buffer", "length", NULL };
|
static char *keywords[] = { "address", "buffer", "length", NULL };
|
||||||
@ -576,13 +576,17 @@ infpy_write_memory (PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
&length_obj))
|
&length_obj))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
buffer = pybuf.buf;
|
buffer = (const gdb_byte *) pybuf.buf;
|
||||||
buf_len = pybuf.len;
|
buf_len = pybuf.len;
|
||||||
#else
|
#else
|
||||||
|
const void *vbuffer;
|
||||||
|
|
||||||
if (! PyArg_ParseTupleAndKeywords (args, kw, "Os#|O", keywords,
|
if (! PyArg_ParseTupleAndKeywords (args, kw, "Os#|O", keywords,
|
||||||
&addr_obj, &buffer, &buf_len,
|
&addr_obj, &buffer, &buf_len,
|
||||||
&length_obj))
|
&length_obj))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
buffer = (const gdb_byte *) buffer;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (get_addr_from_python (addr_obj, &addr) < 0)
|
if (get_addr_from_python (addr_obj, &addr) < 0)
|
||||||
@ -595,7 +599,7 @@ infpy_write_memory (PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
|
|
||||||
TRY
|
TRY
|
||||||
{
|
{
|
||||||
write_memory_with_notification (addr, (gdb_byte *) buffer, length);
|
write_memory_with_notification (addr, buffer, length);
|
||||||
}
|
}
|
||||||
CATCH (ex, RETURN_MASK_ALL)
|
CATCH (ex, RETURN_MASK_ALL)
|
||||||
{
|
{
|
||||||
@ -717,7 +721,7 @@ infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
static char *keywords[] = { "address", "length", "pattern", NULL };
|
static char *keywords[] = { "address", "length", "pattern", NULL };
|
||||||
PyObject *start_addr_obj, *length_obj;
|
PyObject *start_addr_obj, *length_obj;
|
||||||
Py_ssize_t pattern_size;
|
Py_ssize_t pattern_size;
|
||||||
const void *buffer;
|
const gdb_byte *buffer;
|
||||||
CORE_ADDR found_addr;
|
CORE_ADDR found_addr;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
#ifdef IS_PY3K
|
#ifdef IS_PY3K
|
||||||
@ -728,10 +732,11 @@ infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
&pybuf))
|
&pybuf))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
buffer = pybuf.buf;
|
buffer = (const gdb_byte *) pybuf.buf;
|
||||||
pattern_size = pybuf.len;
|
pattern_size = pybuf.len;
|
||||||
#else
|
#else
|
||||||
PyObject *pattern;
|
PyObject *pattern;
|
||||||
|
const void *vbuffer;
|
||||||
|
|
||||||
if (! PyArg_ParseTupleAndKeywords (args, kw, "OOO", keywords,
|
if (! PyArg_ParseTupleAndKeywords (args, kw, "OOO", keywords,
|
||||||
&start_addr_obj, &length_obj,
|
&start_addr_obj, &length_obj,
|
||||||
@ -746,8 +751,10 @@ infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PyObject_AsReadBuffer (pattern, &buffer, &pattern_size) == -1)
|
if (PyObject_AsReadBuffer (pattern, &vbuffer, &pattern_size) == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
buffer = (const gdb_byte *) vbuffer;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (get_addr_from_python (start_addr_obj, &start_addr) < 0)
|
if (get_addr_from_python (start_addr_obj, &start_addr) < 0)
|
||||||
|
@ -710,11 +710,11 @@ regcache_raw_read_unsigned (struct regcache *regcache, int regnum,
|
|||||||
void
|
void
|
||||||
regcache_raw_write_signed (struct regcache *regcache, int regnum, LONGEST val)
|
regcache_raw_write_signed (struct regcache *regcache, int regnum, LONGEST val)
|
||||||
{
|
{
|
||||||
void *buf;
|
gdb_byte *buf;
|
||||||
|
|
||||||
gdb_assert (regcache != NULL);
|
gdb_assert (regcache != NULL);
|
||||||
gdb_assert (regnum >=0 && regnum < regcache->descr->nr_raw_registers);
|
gdb_assert (regnum >=0 && regnum < regcache->descr->nr_raw_registers);
|
||||||
buf = alloca (regcache->descr->sizeof_register[regnum]);
|
buf = (gdb_byte *) alloca (regcache->descr->sizeof_register[regnum]);
|
||||||
store_signed_integer (buf, regcache->descr->sizeof_register[regnum],
|
store_signed_integer (buf, regcache->descr->sizeof_register[regnum],
|
||||||
gdbarch_byte_order (regcache->descr->gdbarch), val);
|
gdbarch_byte_order (regcache->descr->gdbarch), val);
|
||||||
regcache_raw_write (regcache, regnum, buf);
|
regcache_raw_write (regcache, regnum, buf);
|
||||||
@ -724,11 +724,11 @@ void
|
|||||||
regcache_raw_write_unsigned (struct regcache *regcache, int regnum,
|
regcache_raw_write_unsigned (struct regcache *regcache, int regnum,
|
||||||
ULONGEST val)
|
ULONGEST val)
|
||||||
{
|
{
|
||||||
void *buf;
|
gdb_byte *buf;
|
||||||
|
|
||||||
gdb_assert (regcache != NULL);
|
gdb_assert (regcache != NULL);
|
||||||
gdb_assert (regnum >=0 && regnum < regcache->descr->nr_raw_registers);
|
gdb_assert (regnum >=0 && regnum < regcache->descr->nr_raw_registers);
|
||||||
buf = alloca (regcache->descr->sizeof_register[regnum]);
|
buf = (gdb_byte *) alloca (regcache->descr->sizeof_register[regnum]);
|
||||||
store_unsigned_integer (buf, regcache->descr->sizeof_register[regnum],
|
store_unsigned_integer (buf, regcache->descr->sizeof_register[regnum],
|
||||||
gdbarch_byte_order (regcache->descr->gdbarch), val);
|
gdbarch_byte_order (regcache->descr->gdbarch), val);
|
||||||
regcache_raw_write (regcache, regnum, buf);
|
regcache_raw_write (regcache, regnum, buf);
|
||||||
@ -858,11 +858,11 @@ void
|
|||||||
regcache_cooked_write_signed (struct regcache *regcache, int regnum,
|
regcache_cooked_write_signed (struct regcache *regcache, int regnum,
|
||||||
LONGEST val)
|
LONGEST val)
|
||||||
{
|
{
|
||||||
void *buf;
|
gdb_byte *buf;
|
||||||
|
|
||||||
gdb_assert (regcache != NULL);
|
gdb_assert (regcache != NULL);
|
||||||
gdb_assert (regnum >=0 && regnum < regcache->descr->nr_cooked_registers);
|
gdb_assert (regnum >=0 && regnum < regcache->descr->nr_cooked_registers);
|
||||||
buf = alloca (regcache->descr->sizeof_register[regnum]);
|
buf = (gdb_byte *) alloca (regcache->descr->sizeof_register[regnum]);
|
||||||
store_signed_integer (buf, regcache->descr->sizeof_register[regnum],
|
store_signed_integer (buf, regcache->descr->sizeof_register[regnum],
|
||||||
gdbarch_byte_order (regcache->descr->gdbarch), val);
|
gdbarch_byte_order (regcache->descr->gdbarch), val);
|
||||||
regcache_cooked_write (regcache, regnum, buf);
|
regcache_cooked_write (regcache, regnum, buf);
|
||||||
@ -872,11 +872,11 @@ void
|
|||||||
regcache_cooked_write_unsigned (struct regcache *regcache, int regnum,
|
regcache_cooked_write_unsigned (struct regcache *regcache, int regnum,
|
||||||
ULONGEST val)
|
ULONGEST val)
|
||||||
{
|
{
|
||||||
void *buf;
|
gdb_byte *buf;
|
||||||
|
|
||||||
gdb_assert (regcache != NULL);
|
gdb_assert (regcache != NULL);
|
||||||
gdb_assert (regnum >=0 && regnum < regcache->descr->nr_cooked_registers);
|
gdb_assert (regnum >=0 && regnum < regcache->descr->nr_cooked_registers);
|
||||||
buf = alloca (regcache->descr->sizeof_register[regnum]);
|
buf = (gdb_byte *) alloca (regcache->descr->sizeof_register[regnum]);
|
||||||
store_unsigned_integer (buf, regcache->descr->sizeof_register[regnum],
|
store_unsigned_integer (buf, regcache->descr->sizeof_register[regnum],
|
||||||
gdbarch_byte_order (regcache->descr->gdbarch), val);
|
gdbarch_byte_order (regcache->descr->gdbarch), val);
|
||||||
regcache_cooked_write (regcache, regnum, buf);
|
regcache_cooked_write (regcache, regnum, buf);
|
||||||
|
@ -1222,7 +1222,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
|
|||||||
TYPE, and copy that, in virtual format, into VALBUF. */
|
TYPE, and copy that, in virtual format, into VALBUF. */
|
||||||
static void
|
static void
|
||||||
sh64_extract_return_value (struct type *type, struct regcache *regcache,
|
sh64_extract_return_value (struct type *type, struct regcache *regcache,
|
||||||
void *valbuf)
|
gdb_byte *valbuf)
|
||||||
{
|
{
|
||||||
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);
|
||||||
|
Reference in New Issue
Block a user