diff options
author | Maxim Kuvyrkov <maxim@kugelworks.com> | 2010-05-19 14:07:08 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim@kugelworks.com> | 2010-05-19 14:07:08 +0000 |
commit | fea36a59a1a87dfa973f911f11ab1a43b0f528c0 (patch) | |
tree | 1efad99654c33be0aafb4164d7d009cc11244a8a | |
parent | 9c8b3bfecd1fbea30d513b02785496b19bcb581d (diff) | |
download | gdb-fea36a59a1a87dfa973f911f11ab1a43b0f528c0.zip gdb-fea36a59a1a87dfa973f911f11ab1a43b0f528c0.tar.gz gdb-fea36a59a1a87dfa973f911f11ab1a43b0f528c0.tar.bz2 |
* linux-m68k-low.c: Include <asm/ptrace.h>
(ps_get_thread_area): Implement.
-rw-r--r-- | gdb/gdbserver/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/gdbserver/linux-m68k-low.c | 19 |
2 files changed, 24 insertions, 0 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index eb82920..8c81fb0 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2010-05-19 Maxim Kuvyrkov <maxim@codesourcery.com> + + * linux-m68k-low.c: Include <asm/ptrace.h> + (ps_get_thread_area): Implement. + 2010-05-03 Doug Evans <dje@google.com> * event-loop.c (struct callback_event): New struct. diff --git a/gdb/gdbserver/linux-m68k-low.c b/gdb/gdbserver/linux-m68k-low.c index 6c98bb1..1caac74 100644 --- a/gdb/gdbserver/linux-m68k-low.c +++ b/gdb/gdbserver/linux-m68k-low.c @@ -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, |