gdb/
authorDaniel Jacobowitz <drow@false.org>
Tue, 30 May 2006 15:57:09 +0000 (15:57 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 30 May 2006 15:57:09 +0000 (15:57 +0000)
* Makefile.in (arm-linux-nat.o): Update dependencies.
* arm-linux-nat.c: Include "gdb_proc_service.h".
(PTRACE_GET_THREAD_AREA): Define.
(ps_get_thread_area): New function.
gdb/gdbserver/
* Makefile.in (linux-arm-low.o): Update dependencies.
* linux-arm-low.c: Include "../gdb_proc_service.h".
(PTRACE_GET_THREAD_AREA): Define.
(ps_get_thread_area): New function.

gdb/ChangeLog
gdb/Makefile.in
gdb/arm-linux-nat.c
gdb/gdbserver/ChangeLog
gdb/gdbserver/Makefile.in
gdb/gdbserver/linux-arm-low.c

index f96c664c796b316edb75fbbd0da7c4be3f1cc859..84ab7f590643367a6096e3fa15b432d487475e99 100644 (file)
@@ -1,3 +1,10 @@
+2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * Makefile.in (arm-linux-nat.o): Update dependencies.
+       * arm-linux-nat.c: Include "gdb_proc_service.h".
+       (PTRACE_GET_THREAD_AREA): Define.
+       (ps_get_thread_area): New function.
+
 2006-05-28  Alexandre Oliva  <aoliva@redhat.com>
 
        * dwarf2-frame.h (enum dwarf2_frame_reg_rule): Add
index 6f3d911634a000eac91e68ad1b9f50b1f7400ff6..e76828425f37c04ea243660b7db35a01c8604b2d 100644 (file)
@@ -1769,7 +1769,7 @@ arch-utils.o: arch-utils.c $(defs_h) $(arch_utils_h) $(buildsym_h) \
        $(floatformat_h)
 arm-linux-nat.o: arm-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
        $(gdb_string_h) $(regcache_h) $(arm_tdep_h) $(gregset_h) \
-       $(target_h) $(linux_nat_h)
+       $(target_h) $(linux_nat_h) $(gdb_proc_service_h)
 arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \
        $(gdbtypes_h) $(floatformat_h) $(gdbcore_h) $(frame_h) $(regcache_h) \
        $(doublest_h) $(solib_svr4_h) $(osabi_h) $(arm_tdep_h) \
index 8023026a209fb4dcf140b2485086e02d4a0d679d..0cfec203f5e46c8c86a7f3ddd35f7804d2b17102 100644 (file)
 /* Prototypes for supply_gregset etc. */
 #include "gregset.h"
 
+/* Defines ps_err_e, struct ps_prochandle.  */
+#include "gdb_proc_service.h"
+
+#ifndef PTRACE_GET_THREAD_AREA
+#define PTRACE_GET_THREAD_AREA 22
+#endif
+
 extern int arm_apcs_32;
 
 #define                typeNone                0x00
@@ -694,6 +701,23 @@ arm_linux_kernel_u_size (void)
   return (sizeof (struct user));
 }
 
+/* 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;
+}
+
 static unsigned int
 get_linux_version (unsigned int *vmajor,
                   unsigned int *vminor,
index 1a0ddf3e017f6ee6025e3b3f645ac536e5a14ce3..14baaf6ef2be997a1721bb390ee68d205477a69f 100644 (file)
@@ -1,3 +1,10 @@
+2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * Makefile.in (linux-arm-low.o): Update dependencies.
+       * linux-arm-low.c: Include "../gdb_proc_service.h".
+       (PTRACE_GET_THREAD_AREA): Define.
+       (ps_get_thread_area): New function.
+
 2006-05-09  Nathan Sidwell  <nathan@codesourcery.com>
 
        * configure.srv (m68k*-*-uclinux*): New target.
index 0da5f6cde6876f717af6248e9b9c097ebb38053a..9dc77deb3146ca59754fe19ff1381aad99b95c68 100644 (file)
@@ -269,7 +269,8 @@ linux_low_h = $(srcdir)/linux-low.h
 linux-low.o: linux-low.c $(linux_low_h) $(server_h)
        $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< @USE_THREAD_DB@
 
-linux-arm-low.o: linux-arm-low.c $(linux_low_h) $(server_h)
+linux-arm-low.o: linux-arm-low.c $(linux_low_h) $(server_h) \
+       $(gdb_proc_service_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) \
index b2c314fef8176b4446d70651cf48f61d9fc4465d..c01f97ad8931fe8459b9f738a9d276ebb9788295 100644 (file)
@@ -1,5 +1,6 @@
 /* GNU/Linux/ARM specific low level interface, for the remote server for GDB.
-   Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 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 22
+#endif
+
 #ifdef HAVE_SYS_REG_H
 #include <sys/reg.h>
 #endif
@@ -105,6 +114,23 @@ arm_reinsert_addr ()
   return pc;
 }
 
+/* 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 = {
   arm_num_regs,
   arm_regmap,
This page took 0.036156 seconds and 4 git commands to generate.