/* Target dependent code for CRIS, for GDB, the GNU debugger.
- Copyright (C) 2001-2013 Free Software Foundation, Inc.
+ Copyright (C) 2001-2016 Free Software Foundation, Inc.
Contributed by Axis Communications AB.
Written by Hendrik Ruijter, Stefan Andersson, and Orjan Friberg.
#include "target.h"
#include "value.h"
#include "opcode/cris.h"
+#include "osabi.h"
#include "arch-utils.h"
#include "regcache.h"
-#include "gdb_assert.h"
#include "objfiles.h"
#include "solib.h" /* Support for shared libraries. */
#include "solib-svr4.h"
-#include "gdb_string.h"
#include "dis-asm.h"
+#include "cris-tdep.h"
+
enum cris_num_regs
{
/* There are no floating point registers. Used in gdbserver low-linux.c. */
/* Whether to make use of Dwarf-2 CFI (default on). */
static int usr_cmd_cris_dwarf2_cfi = 1;
-/* CRIS architecture specific information. */
-struct gdbarch_tdep
-{
- unsigned int cris_version;
- const char *cris_mode;
- int cris_dwarf2_cfi;
-};
-
/* Sigtramp identification code copied from i386-linux-tdep.c. */
#define SIGTRAMP_INSN0 0x9c5f /* movu.w 0xXX, $r9 */
int i;
if ((*this_cache))
- return (*this_cache);
+ return (struct cris_unwind_cache *) (*this_cache);
info = FRAME_OBSTACK_ZALLOC (struct cris_unwind_cache);
(*this_cache) = info;
int delay_slot_pc_active;
int xflag_found;
int disable_interrupt;
- int byte_order;
+ enum bfd_endian byte_order;
} inst_env_type;
/* Machine-dependencies in CRIS for opcodes. */
{
int len;
struct stack_item *prev;
- void *data;
+ gdb_byte *data;
};
static struct stack_item *
push_stack_item (struct stack_item *prev, const gdb_byte *contents, int len)
{
- struct stack_item *si;
- si = xmalloc (sizeof (struct stack_item));
- si->data = xmalloc (len);
+ struct stack_item *si = XNEW (struct stack_item);
+ si->data = (gdb_byte *) xmalloc (len);
si->len = len;
si->prev = prev;
memcpy (si->data, contents, len);
struct cris_unwind_cache *info;
if ((*this_prologue_cache))
- return (*this_prologue_cache);
+ return (struct cris_unwind_cache *) (*this_prologue_cache);
info = FRAME_OBSTACK_ZALLOC (struct cris_unwind_cache);
(*this_prologue_cache) = info;
if (reg >= 0 && reg < ARRAY_SIZE (cris_dwarf_regmap))
regnum = cris_dwarf_regmap[reg];
- if (regnum == -1)
- warning (_("Unmapped DWARF Register #%d encountered."), reg);
-
return regnum;
}
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
int i;
cris_elf_greg_t *regp = *gregsetp;
- static char zerobuf[4] = {0};
/* The kernel dumps all 32 registers as unsigned longs, but supply_register
knows about the actual size of each register so that's no problem. */
void
_initialize_cris_tdep (void)
{
- static struct cmd_list_element *cris_set_cmdlist;
- static struct cmd_list_element *cris_show_cmdlist;
-
struct cmd_list_element *c;
gdbarch_register (bfd_arch_cris, cris_gdbarch_init, cris_dump_tdep);
}
/* No matching architecture was found. Create a new one. */
- tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
+ tdep = XNEW (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep);
tdep->cris_version = usr_cmd_cris_version;
frame_unwind_append_unwinder (gdbarch, &cris_frame_unwind);
frame_base_set_default (gdbarch, &cris_frame_base);
- set_solib_svr4_fetch_link_map_offsets
- (gdbarch, svr4_ilp32_fetch_link_map_offsets);
-
+ /* Hook in ABI-specific overrides, if they have been registered. */
+ gdbarch_init_osabi (info, gdbarch);
+
/* FIXME: cagney/2003-08-27: It should be possible to select a CRIS
disassembler, even when there is no BFD. Does something like
"gdb; target remote; disassmeble *0x123" work? */