X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fcris-tdep.c;h=6861e2ba65b7a9ea72cf1e30fc23d3d72aa7fc2d;hb=2117c711ae07700adb57ea5b5ca61e4c32d7e3d2;hp=03041e44040d6babc8cfc9b3039a99f1d5cc084c;hpb=e4286e57c527e5b92e0d1458a71dbca7b9b96cec;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 03041e4404..6861e2ba65 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -1,6 +1,6 @@ /* Target dependent code for CRIS, for GDB, the GNU debugger. - Copyright (C) 2001-2013 Free Software Foundation, Inc. + Copyright (C) 2001-2014 Free Software Foundation, Inc. Contributed by Axis Communications AB. Written by Hendrik Ruijter, Stefan Andersson, and Orjan Friberg. @@ -34,6 +34,7 @@ #include "target.h" #include "value.h" #include "opcode/cris.h" +#include "osabi.h" #include "arch-utils.h" #include "regcache.h" #include "gdb_assert.h" @@ -42,9 +43,11 @@ #include "solib.h" /* Support for shared libraries. */ #include "solib-svr4.h" -#include "gdb_string.h" +#include #include "dis-asm.h" +#include "cris-tdep.h" + enum cris_num_regs { /* There are no floating point registers. Used in gdbserver low-linux.c. */ @@ -164,14 +167,6 @@ static const char *usr_cmd_cris_mode = cris_mode_normal; /* 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 */ @@ -3819,26 +3814,25 @@ cris_delayed_get_disassembler (bfd_vma addr, struct disassemble_info *info) return print_insn (addr, info); } -/* Copied from . */ -typedef unsigned long elf_greg_t; +/* Originally from . */ +typedef unsigned char cris_elf_greg_t[4]; /* Same as user_regs_struct struct in . */ #define CRISV10_ELF_NGREG 35 -typedef elf_greg_t elf_gregset_t[CRISV10_ELF_NGREG]; +typedef cris_elf_greg_t cris_elf_gregset_t[CRISV10_ELF_NGREG]; #define CRISV32_ELF_NGREG 32 -typedef elf_greg_t crisv32_elf_gregset_t[CRISV32_ELF_NGREG]; +typedef cris_elf_greg_t crisv32_elf_gregset_t[CRISV32_ELF_NGREG]; -/* Unpack an elf_gregset_t into GDB's register cache. */ +/* Unpack a cris_elf_gregset_t into GDB's register cache. */ static void -cris_supply_gregset (struct regcache *regcache, elf_gregset_t *gregsetp) +cris_supply_gregset (struct regcache *regcache, cris_elf_gregset_t *gregsetp) { struct gdbarch *gdbarch = get_regcache_arch (regcache); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); int i; - elf_greg_t *regp = *gregsetp; - static char zerobuf[4] = {0}; + cris_elf_greg_t *regp = *gregsetp; /* 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. */ @@ -3868,12 +3862,12 @@ fetch_core_registers (struct regcache *regcache, char *core_reg_sect, unsigned core_reg_size, int which, CORE_ADDR reg_addr) { - elf_gregset_t gregset; + cris_elf_gregset_t gregset; switch (which) { case 0: - if (core_reg_size != sizeof (elf_gregset_t) + if (core_reg_size != sizeof (cris_elf_gregset_t) && core_reg_size != sizeof (crisv32_elf_gregset_t)) { warning (_("wrong size gregset struct in core file")); @@ -3906,9 +3900,6 @@ extern initialize_file_ftype _initialize_cris_tdep; /* -Wmissing-prototypes */ 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); @@ -4176,9 +4167,9 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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? */