/* Target-dependent code for the S+core architecture, for GDB,
the GNU Debugger.
- Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
Contributed by Qinwei (qinwei@sunnorth.com.cn)
Contributed by Ching-Peng Lin (cplin@sunplus.com)
}
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);
static inst_t inst = { 0, 0, 0 };
- char buf[SCORE_INSTLEN] = { 0 };
+ gdb_byte buf[SCORE_INSTLEN] = { 0 };
int big;
int ret;
#define EXTRACT_LEN 2
CORE_ADDR adjust_pc = *pcptr & ~0x1;
- int inst_len;
gdb_byte buf[5][EXTRACT_LEN] =
{
{'\0', '\0'},
}
static enum return_value_convention
-score_return_value (struct gdbarch *gdbarch, struct type *func_type,
+score_return_value (struct gdbarch *gdbarch, struct value *function,
struct type *type, struct regcache *regcache,
gdb_byte * readbuf, const gdb_byte * writebuf)
{
return 0;
}
-static char *
+static gdb_byte *
score7_malloc_and_get_memblock (CORE_ADDR addr, CORE_ADDR size)
{
int ret;
- char *memblock = NULL;
+ gdb_byte *memblock = NULL;
if (size < 0)
{
else if (size == 0)
return NULL;
- memblock = (char *) xmalloc (size);
+ memblock = xmalloc (size);
memset (memblock, 0, size);
ret = target_read_memory (addr & ~0x3, memblock, size);
if (ret)
}
static void
-score7_free_memblock (char *memblock)
+score7_free_memblock (gdb_byte *memblock)
{
xfree (memblock);
}
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)
{
if (prev_pc == -1)
int fp_offset_p = 0;
int inst_len = 0;
- char *memblock = NULL;
- char *memblock_ptr = NULL;
+ gdb_byte *memblock = NULL;
+ gdb_byte *memblock_ptr = NULL;
CORE_ADDR prev_pc = -1;
/* Allocate MEMBLOCK if PC - STARTADDR > 0. */
}
}
+static const struct regset score7_linux_gregset =
+ {
+ NULL,
+ score7_linux_supply_gregset, NULL
+ };
+
/* Return the appropriate register set from the core section identified
by SECT_NAME and SECT_SIZE. */
score7_linux_regset_from_core_section(struct gdbarch *gdbarch,
const char *sect_name, size_t sect_size)
{
- struct gdbarch_tdep *tdep;
-
gdb_assert (gdbarch != NULL);
gdb_assert (sect_name != NULL);
- tdep = gdbarch_tdep (gdbarch);
-
if (strcmp(sect_name, ".reg") == 0 && sect_size == sizeof(elf_gregset_t))
- {
- if (tdep->gregset == NULL)
- tdep->gregset = regset_alloc (gdbarch,
- score7_linux_supply_gregset, NULL);
- return tdep->gregset;
- }
+ return &score7_linux_gregset;
return NULL;
}
score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
struct gdbarch *gdbarch;
- struct gdbarch_tdep *tdep;
target_mach = info.bfd_arch_info->mach;
arches = gdbarch_list_lookup_by_info (arches, &info);
{
return (arches->gdbarch);
}
- tdep = xcalloc(1, sizeof(struct gdbarch_tdep));
- gdbarch = gdbarch_alloc (&info, tdep);
+ gdbarch = gdbarch_alloc (&info, NULL);
set_gdbarch_short_bit (gdbarch, 16);
set_gdbarch_int_bit (gdbarch, 32);