ODR warnings for "struct coff_symbol"
[binutils-gdb.git] / gdb / sparc-obsd-tdep.c
index 6cd9227f8aed7161c747400c862c99fbeb3ed221..e4253c11affcfc6b5de85e20bf1a9e0e7c38c49b 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for OpenBSD/sparc.
 
-   Copyright (C) 2004-2021 Free Software Foundation, Inc.
+   Copyright (C) 2004-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -25,6 +25,7 @@
 #include "regcache.h"
 #include "symtab.h"
 #include "trad-frame.h"
+#include "inferior.h"
 
 #include "obsd-tdep.h"
 #include "sparc-tdep.h"
@@ -135,6 +136,7 @@ sparc32obsd_sigtramp_frame_sniffer (const struct frame_unwind *self,
 }
 static const struct frame_unwind sparc32obsd_sigtramp_frame_unwind =
 {
+  "sparc32 openbsd sigtramp",
   SIGTRAMP_FRAME,
   default_frame_unwind_stop_reason,
   sparc32obsd_sigtramp_frame_this_id,
@@ -158,6 +160,9 @@ sparc32obsd_supply_uthread (struct regcache *regcache,
   CORE_ADDR fp, fp_addr = addr + SPARC32OBSD_UTHREAD_FP_OFFSET;
   gdb_byte buf[4];
 
+  /* This function calls functions that depend on the global current thread.  */
+  gdb_assert (regcache->ptid () == inferior_ptid);
+
   gdb_assert (regnum >= -1);
 
   fp = read_memory_unsigned_integer (fp_addr, 4, byte_order);
@@ -203,6 +208,9 @@ sparc32obsd_collect_uthread(const struct regcache *regcache,
   CORE_ADDR sp;
   gdb_byte buf[4];
 
+  /* This function calls functions that depend on the global current thread.  */
+  gdb_assert (regcache->ptid () == inferior_ptid);
+
   gdb_assert (regnum >= -1);
 
   if (regnum == SPARC_SP_REGNUM || regnum == -1)