X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fmicroblaze-tdep.c;h=9cfe3fe51d4750ac381eda25def9d9fe1091f934;hb=e26b7e41652e288dfdb4c48121bba470c4774150;hp=7e8924113669a6ccca7245011f1dc81cc8921a64;hpb=164224e96ca270d6cbb61d3e326fc1b0453b30a6;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index 7e89241136..9cfe3fe51d 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -1,6 +1,6 @@ /* Target-dependent code for Xilinx MicroBlaze. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2016 Free Software Foundation, Inc. This file is part of GDB. @@ -33,8 +33,6 @@ #include "frame-unwind.h" #include "dwarf2-frame.h" #include "osabi.h" -#include "gdb_assert.h" -#include #include "target-descriptions.h" #include "opcodes/microblaze-opcm.h" #include "opcodes/microblaze-dis.h" @@ -130,36 +128,12 @@ microblaze_fetch_instruction (CORE_ADDR pc) gdb_byte buf[4]; /* If we can't read the instruction at PC, return zero. */ - if (target_read_memory (pc, buf, sizeof (buf))) + if (target_read_code (pc, buf, sizeof (buf))) return 0; return extract_unsigned_integer (buf, 4, byte_order); } - -static CORE_ADDR -microblaze_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, - CORE_ADDR funcaddr, - struct value **args, int nargs, - struct type *value_type, - CORE_ADDR *real_pc, CORE_ADDR *bp_addr, - struct regcache *regcache) -{ - error (_("push_dummy_code not implemented")); - return sp; -} - - -static CORE_ADDR -microblaze_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - struct regcache *regcache, CORE_ADDR bp_addr, - int nargs, struct value **args, CORE_ADDR sp, - int struct_return, CORE_ADDR struct_addr) -{ - error (_("store_arguments not implemented")); - return sp; -} - static const gdb_byte * microblaze_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, int *len) @@ -467,7 +441,7 @@ microblaze_frame_cache (struct frame_info *next_frame, void **this_cache) int rn; if (*this_cache) - return *this_cache; + return (struct microblaze_frame_cache *) *this_cache; cache = microblaze_alloc_frame_cache (); *this_cache = cache; @@ -664,8 +638,9 @@ static int dwarf2_to_reg_map[78] = static int microblaze_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg) { - gdb_assert (reg < sizeof (dwarf2_to_reg_map)); - return dwarf2_to_reg_map[reg]; + if (reg >= 0 && reg < sizeof (dwarf2_to_reg_map)) + return dwarf2_to_reg_map[reg]; + return -1; } static void @@ -724,7 +699,13 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) MICROBLAZE_SHR_REGNUM, "rshr"); } - } + + if (!valid_p) + { + tdesc_data_cleanup (tdesc_data); + return NULL; + } + } /* Allocate space for the new architecture. */ tdep = XNEW (struct gdbarch_tdep); @@ -745,8 +726,6 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Call dummy code. */ set_gdbarch_call_dummy_location (gdbarch, ON_STACK); - set_gdbarch_push_dummy_code (gdbarch, microblaze_push_dummy_code); - set_gdbarch_push_dummy_call (gdbarch, microblaze_push_dummy_call); set_gdbarch_return_value (gdbarch, microblaze_return_value); set_gdbarch_stabs_argument_has_addr