X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gdb%2Fnios2-tdep.c;h=91b4381f0b753bd3b8e6a3fdf8de33bc6e83e483;hb=1bf8c7c7551844c69b9445dd887befca82becd72;hp=2955a69dc32d5e9519be3e9705a2bff983495901;hpb=04180708eff91ddd3a9572bd4b517ccce5850db0;p=external%2Fbinutils.git diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c index 2955a69..91b4381 100644 --- a/gdb/nios2-tdep.c +++ b/gdb/nios2-tdep.c @@ -1,5 +1,5 @@ /* Target-machine dependent code for Nios II, for GDB. - Copyright (C) 2012-2016 Free Software Foundation, Inc. + Copyright (C) 2012-2018 Free Software Foundation, Inc. Contributed by Peter Brookes (pbrookes@altera.com) and Andrew Draper (adraper@altera.com). Contributed by Mentor Graphics, Inc. @@ -37,7 +37,6 @@ #include "value.h" #include "symfile.h" #include "arch-utils.h" -#include "floatformat.h" #include "infcall.h" #include "regset.h" #include "target-descriptions.h" @@ -208,13 +207,13 @@ nios2_extract_return_value (struct gdbarch *gdbarch, struct type *valtype, /* Return values of up to 8 bytes are returned in $r2 $r3. */ if (len <= register_size (gdbarch, NIOS2_R2_REGNUM)) - regcache_cooked_read (regcache, NIOS2_R2_REGNUM, valbuf); + regcache->cooked_read (NIOS2_R2_REGNUM, valbuf); else { gdb_assert (len <= (register_size (gdbarch, NIOS2_R2_REGNUM) + register_size (gdbarch, NIOS2_R3_REGNUM))); - regcache_cooked_read (regcache, NIOS2_R2_REGNUM, valbuf); - regcache_cooked_read (regcache, NIOS2_R3_REGNUM, valbuf + 4); + regcache->cooked_read (NIOS2_R2_REGNUM, valbuf); + regcache->cooked_read (NIOS2_R3_REGNUM, valbuf + 4); } } @@ -229,13 +228,13 @@ nios2_store_return_value (struct gdbarch *gdbarch, struct type *valtype, /* Return values of up to 8 bytes are returned in $r2 $r3. */ if (len <= register_size (gdbarch, NIOS2_R2_REGNUM)) - regcache_cooked_write (regcache, NIOS2_R2_REGNUM, valbuf); + regcache->cooked_write (NIOS2_R2_REGNUM, valbuf); else { gdb_assert (len <= (register_size (gdbarch, NIOS2_R2_REGNUM) + register_size (gdbarch, NIOS2_R3_REGNUM))); - regcache_cooked_write (regcache, NIOS2_R2_REGNUM, valbuf); - regcache_cooked_write (regcache, NIOS2_R3_REGNUM, valbuf + 4); + regcache->cooked_write (NIOS2_R2_REGNUM, valbuf); + regcache->cooked_write (NIOS2_R3_REGNUM, valbuf + 4); } } @@ -1772,18 +1771,6 @@ nios2_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size) } } -/* Implement the print_insn gdbarch method. */ - -static int -nios2_print_insn (bfd_vma memaddr, disassemble_info *info) -{ - if (info->endian == BFD_ENDIAN_BIG) - return print_insn_big_nios2 (memaddr, info); - else - return print_insn_little_nios2 (memaddr, info); -} - - /* Implement the frame_align gdbarch method. */ static CORE_ADDR @@ -1830,7 +1817,6 @@ nios2_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int struct_return, CORE_ADDR struct_addr) { int argreg; - int float_argreg; int argnum; int len = 0; int stack_offset = 0; @@ -2126,9 +2112,9 @@ static const struct frame_unwind nios2_stub_frame_unwind = branch prediction. */ static CORE_ADDR -nios2_get_next_pc (struct frame_info *frame, CORE_ADDR pc) +nios2_get_next_pc (struct regcache *regcache, CORE_ADDR pc) { - struct gdbarch *gdbarch = get_frame_arch (frame); + struct gdbarch *gdbarch = regcache->arch (); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); unsigned long mach = gdbarch_bfd_arch_info (gdbarch)->mach; unsigned int insn; @@ -2146,10 +2132,10 @@ nios2_get_next_pc (struct frame_info *frame, CORE_ADDR pc) if (nios2_match_branch (insn, op, mach, &ra, &rb, &imm, &cond)) { - int ras = get_frame_register_signed (frame, ra); - int rbs = get_frame_register_signed (frame, rb); - unsigned int rau = get_frame_register_unsigned (frame, ra); - unsigned int rbu = get_frame_register_unsigned (frame, rb); + int ras = regcache_raw_get_signed (regcache, ra); + int rbs = regcache_raw_get_signed (regcache, rb); + unsigned int rau = regcache_raw_get_unsigned (regcache, ra); + unsigned int rbu = regcache_raw_get_unsigned (regcache, rb); pc += op->size; switch (cond) @@ -2192,7 +2178,7 @@ nios2_get_next_pc (struct frame_info *frame, CORE_ADDR pc) else if (nios2_match_jmpr (insn, op, mach, &ra) || nios2_match_callr (insn, op, mach, &ra)) - pc = get_frame_register_unsigned (frame, ra); + pc = regcache_raw_get_unsigned (regcache, ra); else if (nios2_match_ldwm (insn, op, mach, &uimm, &ra, &imm, &wb, &id, &ret) && ret) @@ -2200,15 +2186,15 @@ nios2_get_next_pc (struct frame_info *frame, CORE_ADDR pc) /* If ra is in the reglist, we have to use the value saved in the stack frame rather than the current value. */ if (uimm & (1 << NIOS2_RA_REGNUM)) - pc = nios2_unwind_pc (gdbarch, frame); + pc = nios2_unwind_pc (gdbarch, get_current_frame ()); else - pc = get_frame_register_unsigned (frame, NIOS2_RA_REGNUM); + pc = regcache_raw_get_unsigned (regcache, NIOS2_RA_REGNUM); } else if (nios2_match_trap (insn, op, mach, &uimm) && uimm == 0) { if (tdep->syscall_next_pc != NULL) - return tdep->syscall_next_pc (frame, op); + return tdep->syscall_next_pc (get_current_frame (), op); } else @@ -2219,16 +2205,12 @@ nios2_get_next_pc (struct frame_info *frame, CORE_ADDR pc) /* Implement the software_single_step gdbarch method. */ -static int -nios2_software_single_step (struct frame_info *frame) +static std::vector +nios2_software_single_step (struct regcache *regcache) { - struct gdbarch *gdbarch = get_frame_arch (frame); - struct address_space *aspace = get_frame_address_space (frame); - CORE_ADDR next_pc = nios2_get_next_pc (frame, get_frame_pc (frame)); - - insert_single_step_breakpoint (gdbarch, aspace, next_pc); + CORE_ADDR next_pc = nios2_get_next_pc (regcache, regcache_read_pc (regcache)); - return 1; + return {next_pc}; } /* Implement the get_longjump_target gdbarch method. */ @@ -2360,8 +2342,6 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) frame_base_set_default (gdbarch, &nios2_frame_base); - set_gdbarch_print_insn (gdbarch, nios2_print_insn); - /* Enable inferior call support. */ set_gdbarch_push_dummy_call (gdbarch, nios2_push_dummy_call); @@ -2371,8 +2351,6 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return gdbarch; } -extern initialize_file_ftype _initialize_nios2_tdep; /* -Wmissing-prototypes */ - void _initialize_nios2_tdep (void) {