aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/server.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-09-15 18:02:51 +0200
committerSimon Marchi <simon.marchi@ericsson.com>2017-09-15 18:02:51 +0200
commit124aceb46dfd1f836f35d6075ead4e00e705f6f3 (patch)
tree768d8a85c5f426f44ac969495512cf1a99e0cfa5 /gdb/gdbserver/server.c
parent96cde54f0adf2315404f3eba35dc3dfbc57f98c8 (diff)
downloadgdb-124aceb46dfd1f836f35d6075ead4e00e705f6f3.zip
gdb-124aceb46dfd1f836f35d6075ead4e00e705f6f3.tar.gz
gdb-124aceb46dfd1f836f35d6075ead4e00e705f6f3.tar.bz2
gdbserver: Remove thread_to_gdb_id
As explained in the previous patch, the gdb_id concept is no longer relevant. The function thread_to_gdb_id is trivial, it returns the thread's ptid. Remove it and replace its usage with ptid_of. The changes in nto-low.c and lynx-low.c are fairly straightforward, but I was not able to build test them. gdb/gdbserver/ChangeLog: * inferiors.h (thread_to_gdb_id): Remove. * inferiors.c (thread_to_gdb_id): Remove. * server.c (handle_qxfer_threads_worker, handle_query): Adjust. * lynx-low.c (lynx_resume, lynx_wait_1, lynx_fetch_registers, lynx_store_registers, lynx_read_memory, lynx_write_memory): Likewise. * nto-low.c (nto_fetch_registers, nto_store_registers, nto_stopped_by_watchpoint, nto_stopped_data_address): Likewise.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r--gdb/gdbserver/server.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 32c9bab..6593d6b 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -1687,7 +1687,7 @@ handle_qxfer_threads_worker (struct inferior_list_entry *inf, void *arg)
{
struct thread_info *thread = (struct thread_info *) inf;
struct buffer *buffer = (struct buffer *) arg;
- ptid_t ptid = thread_to_gdb_id (thread);
+ ptid_t ptid = ptid_of (thread);
char ptid_s[100];
int core = target_core_of_thread (ptid);
char core_s[21];
@@ -2171,21 +2171,20 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
/* Reply the current thread id. */
if (strcmp ("qC", own_buf) == 0 && !disable_packet_qC)
{
- ptid_t gdb_id;
+ ptid_t ptid;
require_running_or_return (own_buf);
- if (!ptid_equal (general_thread, null_ptid)
- && !ptid_equal (general_thread, minus_one_ptid))
- gdb_id = general_thread;
+ if (general_thread != null_ptid && general_thread != minus_one_ptid)
+ ptid = general_thread;
else
{
thread_ptr = get_first_inferior (&all_threads);
- gdb_id = thread_to_gdb_id ((struct thread_info *)thread_ptr);
+ ptid = thread_ptr->id;
}
sprintf (own_buf, "QC");
own_buf += 2;
- write_ptid (own_buf, gdb_id);
+ write_ptid (own_buf, ptid);
return;
}
@@ -2241,28 +2240,22 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
{
if (strcmp ("qfThreadInfo", own_buf) == 0)
{
- ptid_t gdb_id;
-
require_running_or_return (own_buf);
thread_ptr = get_first_inferior (&all_threads);
*own_buf++ = 'm';
- gdb_id = thread_to_gdb_id ((struct thread_info *)thread_ptr);
- write_ptid (own_buf, gdb_id);
+ write_ptid (own_buf, thread_ptr->id);
thread_ptr = thread_ptr->next;
return;
}
if (strcmp ("qsThreadInfo", own_buf) == 0)
{
- ptid_t gdb_id;
-
require_running_or_return (own_buf);
if (thread_ptr != NULL)
{
*own_buf++ = 'm';
- gdb_id = thread_to_gdb_id ((struct thread_info *)thread_ptr);
- write_ptid (own_buf, gdb_id);
+ write_ptid (own_buf, thread_ptr->id);
thread_ptr = thread_ptr->next;
return;
}