* gas/config/tc-avr.c: Change ISA for devices with USB support to
[external/binutils.git] / gdb / gdbserver / linux-ppc-low.c
index 10a1309..1c81c79 100644 (file)
@@ -1,7 +1,6 @@
 /* GNU/Linux/PowerPC specific low level interface, for the remote server for
    GDB.
-   Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2008,
-   2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1995-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -255,7 +254,8 @@ ppc_get_pc (struct regcache *regcache)
     {
       unsigned int pc;
       (*the_target->read_memory) (addr, (unsigned char *) &pc, 4);
-      return ((CORE_ADDR)1 << 63) | ((CORE_ADDR)fd << 32) | (CORE_ADDR) (pc - 4);
+      return ((CORE_ADDR)1 << 63)
+       | ((CORE_ADDR)fd << 32) | (CORE_ADDR) (pc - 4);
     }
   else if (register_size (0) == 4)
     {
@@ -345,8 +345,10 @@ ppc_arch_setup (void)
 
   /* Only if the high bit of the MSR is set, we actually have
      a 64-bit inferior.  */
-  regcache = get_thread_regcache (current_inferior, 1);
+  regcache = new_register_cache ();
+  fetch_inferior_registers (regcache, find_regno ("msr"));
   collect_register_by_name (regcache, "msr", &msr);
+  free_register_cache (regcache);
   if (msr < 0)
     {
       ppc_get_hwcap (&ppc_hwcap);
@@ -593,22 +595,24 @@ struct regset_info target_regsets[] = {
      fetch them every time, but still fall back to PTRACE_PEEKUSER for the
      general registers.  Some kernels support these, but not the newer
      PPC_PTRACE_GETREGS.  */
-  { PTRACE_GETVSXREGS, PTRACE_SETVSXREGS, SIZEOF_VSXREGS, EXTENDED_REGS,
+  { PTRACE_GETVSXREGS, PTRACE_SETVSXREGS, 0, SIZEOF_VSXREGS, EXTENDED_REGS,
   ppc_fill_vsxregset, ppc_store_vsxregset },
-  { PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, EXTENDED_REGS,
+  { PTRACE_GETVRREGS, PTRACE_SETVRREGS, 0, SIZEOF_VRREGS, EXTENDED_REGS,
     ppc_fill_vrregset, ppc_store_vrregset },
-  { PTRACE_GETEVRREGS, PTRACE_SETEVRREGS, 32 * 4 + 8 + 4, EXTENDED_REGS,
+  { PTRACE_GETEVRREGS, PTRACE_SETEVRREGS, 0, 32 * 4 + 8 + 4, EXTENDED_REGS,
     ppc_fill_evrregset, ppc_store_evrregset },
-  { 0, 0, 0, GENERAL_REGS, ppc_fill_gregset, NULL },
-  { 0, 0, -1, -1, NULL, NULL }
+  { 0, 0, 0, 0, GENERAL_REGS, ppc_fill_gregset, NULL },
+  { 0, 0, 0, -1, -1, NULL, NULL }
 };
 
 struct linux_target_ops the_low_target = {
   ppc_arch_setup,
   ppc_num_regs,
   ppc_regmap,
+  NULL,
   ppc_cannot_fetch_register,
   ppc_cannot_store_register,
+  NULL, /* fetch_register */
   ppc_get_pc,
   ppc_set_pc,
   (const unsigned char *) &ppc_breakpoint,