X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Frs6000-tdep.c;h=a15f757072d18883ca6263b6dedab436272a6956;hb=45a466b578083a05f1138eff9232254b1a30f683;hp=23fe9e336fe3a5092c32cdda2bf9abb1fe9f523c;hpb=8dccd430c9de0e6cf747ae4bb1bf9d944fe3397c;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 23fe9e336f..a15f757072 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -1,8 +1,6 @@ /* Target-dependent code for GDB, the GNU debugger. - Copyright (C) 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, - 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, - 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 1986-2013 Free Software Foundation, Inc. This file is part of GDB. @@ -53,6 +51,7 @@ #include "solib-svr4.h" #include "ppc-tdep.h" +#include "ppc-ravenscar-thread.h" #include "gdb_assert.h" #include "dis-asm.h" @@ -109,7 +108,7 @@ static struct cmd_list_element *showpowerpccmdlist = NULL; static enum auto_boolean powerpc_soft_float_global = AUTO_BOOLEAN_AUTO; /* The vector ABI to use. Keep this in sync with powerpc_vector_abi. */ -static const char *powerpc_vector_strings[] = +static const char *const powerpc_vector_strings[] = { "auto", "generic", @@ -1116,8 +1115,8 @@ ppc_deal_with_atomic_sequence (struct frame_info *frame) its destination address. */ if ((insn & BRANCH_MASK) == BC_INSN) { - int immediate = ((insn & ~3) << 16) >> 16; - int absolute = ((insn >> 1) & 1); + int immediate = ((insn & 0xfffc) ^ 0x8000) - 0x8000; + int absolute = insn & 2; if (bc_insn_count >= 1) return 0; /* More than one conditional branch found, fallback @@ -1126,7 +1125,7 @@ ppc_deal_with_atomic_sequence (struct frame_info *frame) if (absolute) breaks[1] = immediate; else - breaks[1] = pc + immediate; + breaks[1] = loc + immediate; bc_insn_count++; last_breakpoint++; @@ -1150,11 +1149,10 @@ ppc_deal_with_atomic_sequence (struct frame_info *frame) breaks[0] = loc; /* Check for duplicated breakpoints. Check also for a breakpoint - placed (branch instruction's destination) at the stwcx/stdcx - instruction, this resets the reservation and take us back to the - lwarx/ldarx instruction at the beginning of the atomic sequence. */ - if (last_breakpoint && ((breaks[1] == breaks[0]) - || (breaks[1] == closing_insn))) + placed (branch instruction's destination) anywhere in sequence. */ + if (last_breakpoint + && (breaks[1] == breaks[0] + || (breaks[1] >= pc && breaks[1] <= closing_insn))) last_breakpoint = 0; /* Effectively inserts the breakpoints. */ @@ -1824,6 +1822,15 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, /* Set up frame pointer */ } + else if (op == 0x603d0000) /* oril r29, r1, 0x0 */ + { + fdata->frameless = 0; + framep = 1; + fdata->alloca_reg = (tdep->ppc_gp0_regnum + 29); + continue; + + /* Another way to set up the frame pointer. */ + } else if (op == 0x603f0000 /* oril r31, r1, 0x0 */ || op == 0x7c3f0b78) { /* mr r31, r1 */ @@ -2191,7 +2198,7 @@ rs6000_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) static int rs6000_in_solib_return_trampoline (struct gdbarch *gdbarch, - CORE_ADDR pc, char *name) + CORE_ADDR pc, const char *name) { return name && !strncmp (name, "@FIX", 4); } @@ -3077,21 +3084,6 @@ find_variant_by_arch (enum bfd_architecture arch, unsigned long mach) static int gdb_print_insn_powerpc (bfd_vma memaddr, disassemble_info *info) { - if (!info->disassembler_options) - { - /* When debugging E500 binaries and disassembling code containing - E500-specific (SPE) instructions, one sometimes sees AltiVec - instructions instead. The opcode spaces for SPE instructions - and AltiVec instructions overlap, and specifiying the "any" cpu - looks for AltiVec instructions first. If we know we're - debugging an E500 binary, however, we can specify the "e500x2" - cpu and get much more sane disassembly output. */ - if (info->mach == bfd_mach_ppc_e500) - info->disassembler_options = "e500x2"; - else - info->disassembler_options = "any"; - } - if (info->endian == BFD_ENDIAN_BIG) return print_insn_big_powerpc (memaddr, info); else @@ -3319,6 +3311,7 @@ rs6000_frame_prev_register (struct frame_info *this_frame, static const struct frame_unwind rs6000_frame_unwind = { NORMAL_FRAME, + default_frame_unwind_stop_reason, rs6000_frame_this_id, rs6000_frame_prev_register, NULL, @@ -3544,7 +3537,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) enum bfd_architecture arch; unsigned long mach; bfd abfd; - asection *sect; enum auto_boolean soft_float_flag = powerpc_soft_float_global; int soft_float; enum powerpc_vector_abi vector_abi = powerpc_vector_abi_global; @@ -4161,6 +4153,12 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) gdb_assert (gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch) == cur_reg); + /* Register the ravenscar_arch_ops. */ + if (mach == bfd_mach_ppc_e500) + register_e500_ravenscar_ops (gdbarch); + else + register_ppc_ravenscar_ops (gdbarch); + return gdbarch; }