* linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
authorDaniel Jacobowitz <drow@false.org>
Wed, 15 Mar 2006 16:26:02 +0000 (16:26 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 15 Mar 2006 16:26:02 +0000 (16:26 +0000)
(PTRACE_GET_THREAD_AREA): Define.
(ps_get_thread_area): New function.
* Makefile.in (linux-i386-low.o, linux-mips-low.o)
(linux-x86-64-low.o): Update.

gdb/gdbserver/ChangeLog
gdb/gdbserver/Makefile.in
gdb/gdbserver/linux-mips-low.c

index f7e94947f8ef6f46fd1f7631becea2632db30d45..3c13ba6d8730fe9c6cb072e83f9c319a7e2a8477 100644 (file)
@@ -1,3 +1,11 @@
+2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
+       (PTRACE_GET_THREAD_AREA): Define.
+       (ps_get_thread_area): New function.
+       * Makefile.in (linux-i386-low.o, linux-mips-low.o)
+       (linux-x86-64-low.o): Update.
+
 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * configure.ac: Remove checks for prfpregset_t.
index 47d90660d6815f371e19260fff7656c1f4739ade..0da5f6cde6876f717af6248e9b9c097ebb38053a 100644 (file)
@@ -272,15 +272,18 @@ linux-low.o: linux-low.c $(linux_low_h) $(server_h)
 linux-arm-low.o: linux-arm-low.c $(linux_low_h) $(server_h)
 linux-cris-low.o: linux-cris-low.c $(linux_low_h) $(server_h)
 linux-crisv32-low.o: linux-crisv32-low.c $(linux_low_h) $(server_h)
-linux-i386-low.o: linux-i386-low.c $(linux_low_h) $(server_h)
+linux-i386-low.o: linux-i386-low.c $(linux_low_h) $(server_h) \
+       $(gdb_proc_service_h)
 linux-ia64-low.o: linux-ia64-low.c $(linux_low_h) $(server_h)
 linux-m32r-low.o: linux-m32r-low.c $(linux_low_h) $(server_h)
-linux-mips-low.o: linux-mips-low.c $(linux_low_h) $(server_h)
+linux-mips-low.o: linux-mips-low.c $(linux_low_h) $(server_h) \
+       $(gdb_proc_service_h)
 linux-ppc-low.o: linux-ppc-low.c $(linux_low_h) $(server_h)
 linux-ppc64-low.o: linux-ppc64-low.c $(linux_low_h) $(server_h)
 linux-s390-low.o: linux-s390-low.c $(linux_low_h) $(server_h)
 linux-sh-low.o: linux-sh-low.c $(linux_low_h) $(server_h)
-linux-x86-64-low.o: linux-x86-64-low.c $(linux_low_h) $(server_h)
+linux-x86-64-low.o: linux-x86-64-low.c $(linux_low_h) $(server_h) \
+       $(gdb_proc_service_h)
 
 reg-arm.o : reg-arm.c $(regdef_h)
 reg-arm.c : $(srcdir)/../regformats/reg-arm.dat $(regdat_sh)
index 695bd29bf0d545407efc348b1fe21638b4a74920..78295505f31ee913de4b17ab0dca9769d52d6cc4 100644 (file)
@@ -1,5 +1,5 @@
 /* GNU/Linux/MIPS specific low level interface, for the remote server for GDB.
-   Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2005
+   Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2005, 2006
    Free Software Foundation, Inc.
 
    This file is part of GDB.
 #include "server.h"
 #include "linux-low.h"
 
+#include <sys/ptrace.h>
+
+#include "gdb_proc_service.h"
+
+#ifndef PTRACE_GET_THREAD_AREA
+#define PTRACE_GET_THREAD_AREA 25
+#endif
+
 #ifdef HAVE_SYS_REG_H
 #include <sys/reg.h>
 #endif
@@ -140,6 +148,23 @@ mips_breakpoint_at (CORE_ADDR where)
   return 0;
 }
 
+/* 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 = {
   mips_num_regs,
   mips_regmap,
This page took 0.04254 seconds and 4 git commands to generate.