Fix detach with target remote (PR gdb/28080)
[deliverable/binutils-gdb.git] / gdb / ppc-obsd-tdep.c
index f61dd24b961ab78886b26b37b27db2a602d70271..98b3e4013e9ab8cfa2d158740d7e26337faef379 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for OpenBSD/powerpc.
 
-   Copyright (C) 2004-2016 Free Software Foundation, Inc.
+   Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -88,7 +88,7 @@ ppcobsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                      void *cb_data,
                                      const struct regcache *regcache)
 {
-  cb (".reg", 412, &ppcobsd_gregset, NULL, cb_data);
+  cb (".reg", 412, 412, &ppcobsd_gregset, NULL, cb_data);
 }
 \f
 
@@ -137,7 +137,7 @@ ppcobsd_sigtramp_frame_sniffer (const struct frame_unwind *self,
       unsigned long insn;
 
       if (!safe_frame_unwind_memory (this_frame, start_pc + *offset,
-                                    buf, sizeof buf))
+                                    {buf, sizeof buf}))
        continue;
 
       /* Check for "li r0,SYS_sigreturn".  */
@@ -177,7 +177,7 @@ ppcobsd_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
 
   func = get_frame_pc (this_frame);
   func &= ~(ppcobsd_page_size - 1);
-  if (!safe_frame_unwind_memory (this_frame, func, buf, sizeof buf))
+  if (!safe_frame_unwind_memory (this_frame, func, {buf, sizeof buf}))
     return cache;
 
   /* Calculate the offset where we can find `struct sigcontext'.  We
@@ -232,6 +232,7 @@ ppcobsd_sigtramp_frame_prev_register (struct frame_info *this_frame,
 }
 
 static const struct frame_unwind ppcobsd_sigtramp_frame_unwind = {
+  "ppc openbsd sigtramp",
   SIGTRAMP_FRAME,
   default_frame_unwind_stop_reason,
   ppcobsd_sigtramp_frame_this_id,
@@ -260,35 +261,14 @@ ppcobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   frame_unwind_append_unwinder (gdbarch, &ppcobsd_sigtramp_frame_unwind);
 }
-\f
-
-/* OpenBSD uses uses the traditional NetBSD core file format, even for
-   ports that use ELF.  */
-#define GDB_OSABI_NETBSD_CORE GDB_OSABI_OPENBSD_ELF
-
-static enum gdb_osabi
-ppcobsd_core_osabi_sniffer (bfd *abfd)
-{
-  if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0)
-    return GDB_OSABI_NETBSD_CORE;
-
-  return GDB_OSABI_UNKNOWN;
-}
-\f
-
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-void _initialize_ppcobsd_tdep (void);
 
+void _initialize_ppcobsd_tdep ();
 void
-_initialize_ppcobsd_tdep (void)
+_initialize_ppcobsd_tdep ()
 {
-  /* BFD doesn't set a flavour for NetBSD style a.out core files.  */
-  gdbarch_register_osabi_sniffer (bfd_arch_powerpc, bfd_target_unknown_flavour,
-                                  ppcobsd_core_osabi_sniffer);
-
-  gdbarch_register_osabi (bfd_arch_rs6000, 0, GDB_OSABI_OPENBSD_ELF,
+  gdbarch_register_osabi (bfd_arch_rs6000, 0, GDB_OSABI_OPENBSD,
                          ppcobsd_init_abi);
-  gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_OPENBSD_ELF,
+  gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_OPENBSD,
                          ppcobsd_init_abi);
 
   /* Avoid initializing the register offsets again if they were
@@ -311,10 +291,6 @@ _initialize_ppcobsd_tdep (void)
       ppcobsd_reg_offsets.f0_offset = 128;
       ppcobsd_reg_offsets.fpscr_offset = -1;
 
-      /* AltiVec registers.  */
-      ppcobsd_reg_offsets.vr0_offset = 0;
-      ppcobsd_reg_offsets.vscr_offset = 512;
-      ppcobsd_reg_offsets.vrsave_offset = 520;
     }
 
   if (ppcobsd_fpreg_offsets.fpscr_offset == 0)
This page took 0.025023 seconds and 4 git commands to generate.