X-Git-Url: http://drtracing.org/?a=blobdiff_plain;ds=sidebyside;f=gdb%2Fmep-tdep.c;h=a110b04dab1a7a407c87f55a8d9bdef338f63911;hb=73e6209faecc21516a981ed86a27b259f506098c;hp=b3c1f77244d965d3e7da5e9ea6104da5d7302f8a;hpb=19ba03f49581e407097a3e4821a957c422551ae5;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index b3c1f77244..a110b04dab 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -1,6 +1,6 @@ /* Target-dependent code for the Toshiba MeP for GDB, the GNU debugger. - Copyright (C) 2001-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2016 Free Software Foundation, Inc. Contributed by Red Hat, Inc. @@ -784,7 +784,9 @@ static int mep_debug_reg_to_regnum (struct gdbarch *gdbarch, int debug_reg) { /* The debug info uses the raw register numbers. */ - return mep_raw_to_pseudo[debug_reg]; + if (debug_reg >= 0 && debug_reg < ARRAY_SIZE (mep_raw_to_pseudo)) + return mep_raw_to_pseudo[debug_reg]; + return -1; } @@ -848,7 +850,7 @@ current_me_module (void) ULONGEST regval; regcache_cooked_read_unsigned (get_current_regcache (), MEP_MODULE_REGNUM, ®val); - return regval; + return (CONFIG_ATTR) regval; } else return gdbarch_tdep (target_gdbarch ())->me_module; @@ -1126,7 +1128,7 @@ static enum register_status mep_pseudo_cr32_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, - void *buf) + gdb_byte *buf) { enum register_status status; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -1152,7 +1154,7 @@ static enum register_status mep_pseudo_cr64_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, - void *buf) + gdb_byte *buf) { return regcache_raw_read (regcache, mep_pseudo_to_raw[cookednum], buf); } @@ -1182,7 +1184,7 @@ static void mep_pseudo_csr_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, - const void *buf) + const gdb_byte *buf) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int size = register_size (gdbarch, cookednum); @@ -1213,7 +1215,7 @@ static void mep_pseudo_cr32_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, - const void *buf) + const gdb_byte *buf) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); /* Expand the 32-bit value into a 64-bit value, and write that to @@ -1234,7 +1236,7 @@ static void mep_pseudo_cr64_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, - const void *buf) + const gdb_byte *buf) { regcache_raw_write (regcache, mep_pseudo_to_raw[cookednum], buf); } @@ -2396,7 +2398,10 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* The way to get the me_module code depends on the object file format. At the moment, we only know how to handle ELF. */ if (bfd_get_flavour (info.abfd) == bfd_target_elf_flavour) - me_module = elf_elfheader (info.abfd)->e_flags & EF_MEP_INDEX_MASK; + { + int flag = elf_elfheader (info.abfd)->e_flags & EF_MEP_INDEX_MASK; + me_module = (CONFIG_ATTR) flag; + } else me_module = CONFIG_NONE; }