aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/remote-utils.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2005-07-13 15:02:49 +0000
committerDaniel Jacobowitz <drow@false.org>2005-07-13 15:02:49 +0000
commita06660f79997c37a351afbce6ce75bd0c3de1276 (patch)
treeb65b5cbc4f7cd4d3c25bba690da003c6605be6af /gdb/gdbserver/remote-utils.c
parent5a1f5858d43f5e99d8faa000263051a89ede63d4 (diff)
downloadgdb-a06660f79997c37a351afbce6ce75bd0c3de1276.zip
gdb-a06660f79997c37a351afbce6ce75bd0c3de1276.tar.gz
gdb-a06660f79997c37a351afbce6ce75bd0c3de1276.tar.bz2
* inferiors.c (struct thread_info): Add gdb_id.
(add_thread): Add gdb_id argument. (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New. * linux-low.c (linux_create_inferior, linux_attach_lwp): Update calls to add_thread. * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id. * server.c (handle_query): Use thread_to_gdb_id. (handle_v_cont, main): Use gdb_id_to_thread_id. * server.h (add_thread): Update prototype. (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New prototypes.
Diffstat (limited to 'gdb/gdbserver/remote-utils.c')
-rw-r--r--gdb/gdbserver/remote-utils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 79792a5..f85d262 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -683,6 +683,8 @@ prepare_resume_reply (char *buf, char status, unsigned char signo)
{
/* FIXME right place to set this? */
thread_from_wait = ((struct inferior_list_entry *)current_inferior)->id;
+ unsigned int gdb_id_from_wait = thread_to_gdb_id (current_inferior);
+
if (debug_threads)
fprintf (stderr, "Writing resume reply for %ld\n\n", thread_from_wait);
/* This if (1) ought to be unnecessary. But remote_wait in GDB
@@ -692,7 +694,7 @@ prepare_resume_reply (char *buf, char status, unsigned char signo)
if (1 || old_thread_from_wait != thread_from_wait)
{
general_thread = thread_from_wait;
- sprintf (buf, "thread:%lx;", thread_from_wait);
+ sprintf (buf, "thread:%x;", gdb_id_from_wait);
buf += strlen (buf);
old_thread_from_wait = thread_from_wait;
}