gdb/mi: handle no condition argument case for -break-condition
[deliverable/binutils-gdb.git] / gdb / amd64-obsd-tdep.c
index 71a263f14555e92a2bb36f4ea783f64b832ee653..070f19635aabdbbc7abb58db8887f75a50f43209 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for OpenBSD/amd64.
 
-   Copyright (C) 2003-2019 Free Software Foundation, Inc.
+   Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-
-/* Local non-gdb includes.  */
-#include "amd64-tdep.h"
-#include "bsd-uthread.h"
-#include "common/x86-xstate.h"
-#include "frame-unwind.h"
 #include "frame.h"
+#include "frame-unwind.h"
 #include "gdbcore.h"
-#include "i387-tdep.h"
+#include "symtab.h"
 #include "objfiles.h"
-#include "obsd-tdep.h"
 #include "osabi.h"
 #include "regcache.h"
 #include "regset.h"
-#include "solib-svr4.h"
-#include "symtab.h"
 #include "target.h"
 #include "trad-frame.h"
 
+#include "obsd-tdep.h"
+#include "amd64-tdep.h"
+#include "i387-tdep.h"
+#include "gdbsupport/x86-xstate.h"
+#include "solib-svr4.h"
+#include "bsd-uthread.h"
+
 /* Support for signal handlers.  */
 
 /* Default page size.  */
@@ -79,7 +78,7 @@ amd64obsd_sigtramp_p (struct frame_info *this_frame)
 
   /* If we can't read the instructions at START_PC, return zero.  */
   buf = (gdb_byte *) alloca ((sizeof sigreturn) + 1);
-  if (!safe_frame_unwind_memory (this_frame, start_pc + 6, buf, buflen))
+  if (!safe_frame_unwind_memory (this_frame, start_pc + 6, {buf, buflen}))
     return 0;
 
   /* Check for sigreturn(2).  Depending on how the assembler encoded
@@ -107,11 +106,11 @@ amd64obsd_sigcontext_addr (struct frame_info *this_frame)
   /* The %rsp register points at `struct sigcontext' upon entry of a
      signal trampoline.  The relevant part of the trampoline is
 
-        call    *%rax
-        movq    %rsp, %rdi
-        pushq   %rdi
-        movq    $SYS_sigreturn,%rax
-        int     $0x80
+       call    *%rax
+       movq    %rsp, %rdi
+       pushq   %rdi
+       movq    $SYS_sigreturn,%rax
+       int     $0x80
 
      (see /usr/src/sys/arch/amd64/amd64/locore.S).  The `pushq'
      instruction clobbers %rsp, but its value is saved in `%rdi'.  */
@@ -239,7 +238,7 @@ amd64obsd_supply_uthread (struct regcache *regcache,
       sp = read_memory_unsigned_integer (sp_addr, 8, byte_order);
 
       /* Adjust the stack pointer such that it looks as if we just
-         returned from _thread_machdep_switch.  */
+        returned from _thread_machdep_switch.  */
       offset = amd64obsd_uthread_reg_offset[AMD64_RIP_REGNUM] + 8;
       store_unsigned_integer (buf, 8, byte_order, sp + offset);
       regcache->raw_supply (AMD64_RSP_REGNUM, buf);
@@ -251,7 +250,7 @@ amd64obsd_supply_uthread (struct regcache *regcache,
          && (regnum == -1 || regnum == i))
        {
          /* Fetch stack pointer from thread structure (if we didn't
-             do so already).  */
+            do so already).  */
          if (sp == 0)
            sp = read_memory_unsigned_integer (sp_addr, 8, byte_order);
 
@@ -280,7 +279,7 @@ amd64obsd_collect_uthread (const struct regcache *regcache,
       int offset;
 
       /* Calculate the stack pointer (frame pointer) that will be
-         stored into the thread structure.  */
+        stored into the thread structure.  */
       offset = amd64obsd_uthread_reg_offset[AMD64_RIP_REGNUM] + 8;
       regcache->raw_collect (AMD64_RSP_REGNUM, buf);
       sp = extract_unsigned_integer (buf, 8, byte_order) - offset;
@@ -289,7 +288,7 @@ amd64obsd_collect_uthread (const struct regcache *regcache,
       write_memory_unsigned_integer (sp_addr, 8, byte_order, sp);
 
       /* The stack pointer was (potentially) modified.  Make sure we
-         build a proper stack frame.  */
+        build a proper stack frame.  */
       regnum = -1;
     }
 
@@ -299,7 +298,7 @@ amd64obsd_collect_uthread (const struct regcache *regcache,
          && (regnum == -1 || regnum == i))
        {
          /* Fetch stack pointer from thread structure (if we didn't
-             calculate it already).  */
+            calculate it already).  */
          if (sp == 0)
            sp = read_memory_unsigned_integer (sp_addr, 8, byte_order);
 
@@ -403,10 +402,12 @@ amd64obsd_trapframe_sniffer (const struct frame_unwind *self,
                   || (startswith (name, "Xintr"))));
 }
 
-static const struct frame_unwind amd64obsd_trapframe_unwind = {
+static const struct frame_unwind amd64obsd_trapframe_unwind =
+{
   /* FIXME: kettenis/20051219: This really is more like an interrupt
      frame, but SIGTRAMP_FRAME would print <signal handler called>,
      which really is not what we want here.  */
+  "amd64 openbsd trap",
   NORMAL_FRAME,
   default_frame_unwind_stop_reason,
   amd64obsd_trapframe_this_id,
@@ -449,8 +450,9 @@ amd64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   frame_unwind_prepend_unwinder (gdbarch, &amd64obsd_trapframe_unwind);
 }
 
+void _initialize_amd64obsd_tdep ();
 void
-_initialize_amd64obsd_tdep (void)
+_initialize_amd64obsd_tdep ()
 {
   /* The OpenBSD/amd64 native dependent code makes this assumption.  */
   gdb_assert (ARRAY_SIZE (amd64obsd_r_reg_offset) == AMD64_NUM_GREGS);
This page took 0.02667 seconds and 4 git commands to generate.