aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/inferiors.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-10-17 16:02:27 +0000
committerDaniel Jacobowitz <drow@false.org>2006-10-17 16:02:27 +0000
commitdae5f5cf4b47e0c8b81c090316093ecf5777f770 (patch)
tree7a7f4edbdd4892beda9c8424dc6445c998aeb2a4 /gdb/gdbserver/inferiors.c
parent5bd2f6e2a6179014300f75f86231e0e37736eb6b (diff)
downloadgdb-dae5f5cf4b47e0c8b81c090316093ecf5777f770.zip
gdb-dae5f5cf4b47e0c8b81c090316093ecf5777f770.tar.gz
gdb-dae5f5cf4b47e0c8b81c090316093ecf5777f770.tar.bz2
* acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
* configure.ac: Use it. Define HAVE_TD_THR_TLS_GET_ADDR. * config.in, configure: Regenerated. * inferiors.c (gdb_id_to_thread): New function. (gdb_id_to_thread_id): Use it. * linux-low.c (linux_target_ops): Use thread_db_get_tls_address. * linux-low.h (struct process_info): Add th member. (thread_db_get_tls_address): New prototype. * remote-utils.c (decode_address): Make non-static. * server.c (handle_query): Handle qGetTLSAddr. * server.h (gdb_id_to_thread, decode_address): New prototypes. * target.h (struct target_ops): Add get_tls_address. * thread-db.c (maybe_attach_thread): Save the thread handle. (thread_db_get_tls_address): New.
Diffstat (limited to 'gdb/gdbserver/inferiors.c')
-rw-r--r--gdb/gdbserver/inferiors.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c
index 6fa665f..ff761bc 100644
--- a/gdb/gdbserver/inferiors.c
+++ b/gdb/gdbserver/inferiors.c
@@ -144,8 +144,8 @@ thread_to_gdb_id (struct thread_info *thread)
return thread->gdb_id;
}
-unsigned long
-gdb_id_to_thread_id (unsigned int gdb_id)
+struct thread_info *
+gdb_id_to_thread (unsigned int gdb_id)
{
struct inferior_list_entry *inf = all_threads.head;
@@ -153,11 +153,19 @@ gdb_id_to_thread_id (unsigned int gdb_id)
{
struct thread_info *thread = get_thread (inf);
if (thread->gdb_id == gdb_id)
- return inf->id;
+ return thread;
inf = inf->next;
}
- return 0;
+ return NULL;
+}
+
+unsigned long
+gdb_id_to_thread_id (unsigned int gdb_id)
+{
+ struct thread_info *thread = gdb_id_to_thread (gdb_id);
+
+ return thread ? thread->entry.id : 0;
}
static void