aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparc-obsd-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/sparc-obsd-tdep.c')
-rw-r--r--gdb/sparc-obsd-tdep.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/sparc-obsd-tdep.c b/gdb/sparc-obsd-tdep.c
index 6cd9227..e198e97 100644
--- a/gdb/sparc-obsd-tdep.c
+++ b/gdb/sparc-obsd-tdep.c
@@ -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"
@@ -158,6 +159,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 +207,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)