aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-05-30 15:57:09 +0000
committerDaniel Jacobowitz <drow@false.org>2006-05-30 15:57:09 +0000
commit9308fc88e7f28b38ac63622291a3ec853a72c1c8 (patch)
treed67f03030693a760bbcfa23ec69d35bedb9c8e56 /gdb/gdbserver
parenteebf07fbf50f2054980133a8643ba778bf27667d (diff)
downloadgdb-9308fc88e7f28b38ac63622291a3ec853a72c1c8.zip
gdb-9308fc88e7f28b38ac63622291a3ec853a72c1c8.tar.gz
gdb-9308fc88e7f28b38ac63622291a3ec853a72c1c8.tar.bz2
gdb/
* 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.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog7
-rw-r--r--gdb/gdbserver/Makefile.in3
-rw-r--r--gdb/gdbserver/linux-arm-low.c28
3 files changed, 36 insertions, 2 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 1a0ddf3..14baaf6 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -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.
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 0da5f6c..9dc77de 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -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) \
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index b2c314f..c01f97a 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -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.
@@ -22,6 +23,14 @@
#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,