* linux-m68k-low.c: Include <asm/ptrace.h>
[deliverable/binutils-gdb.git] / gdb / gdbserver / linux-m68k-low.c
index 6c98bb17eebba0895f53473cbb1e4ce41f243ba0..1caac741a81c2c148741d03fb7baecb9a77ae073 100644 (file)
@@ -154,6 +154,25 @@ m68k_breakpoint_at (CORE_ADDR pc)
   return 0;
 }
 
+#include <asm/ptrace.h>
+
+/* Fetch the thread-local storage pointer for libthread_db.  */
+
+ps_err_e
+ps_get_thread_area (const struct ps_prochandle *ph,
+                   lwpid_t lwpid, int idx, void **base)
+{
+  if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
+    return PS_ERR;
+
+  /* IDX is the bias from the thread pointer to the beginning of the
+     thread descriptor.  It has to be subtracted due to implementation
+     quirks in libthread_db.  */
+  *base = (void *) ((char *)*base - idx);
+
+  return PS_OK;
+}
+
 struct linux_target_ops the_low_target = {
   init_registers_m68k,
   m68k_num_regs,
This page took 0.024393 seconds and 4 git commands to generate.