aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/tracepoint.c
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2014-09-10 10:37:11 +0100
committerGary Benson <gbenson@redhat.com>2014-09-16 15:57:13 +0100
commit0bfdf32fa101021ad0d11dd3ae945c823f4b07ac (patch)
tree8789d5ff75836459b77f6ae88ff06ada3b6c300c /gdb/gdbserver/tracepoint.c
parent635856f584de7af4b21bb72688c05cd6d9a0aec6 (diff)
downloadgdb-0bfdf32fa101021ad0d11dd3ae945c823f4b07ac.zip
gdb-0bfdf32fa101021ad0d11dd3ae945c823f4b07ac.tar.gz
gdb-0bfdf32fa101021ad0d11dd3ae945c823f4b07ac.tar.bz2
Rename current_inferior as current_thread in gdbserver
GDB has a function named "current_inferior" and gdbserver has a global variable named "current_inferior", but the two are not equivalent; indeed, gdbserver does not have any real equivalent of what GDB calls an inferior. What gdbserver's "current_inferior" is actually pointing to is a structure describing the current thread. This commit renames current_inferior as current_thread in gdbserver to clarify this. It also renames the function "set_desired_inferior" to "set_desired_thread" and renames various local variables from foo_inferior to foo_thread. gdb/gdbserver/ChangeLog: * inferiors.h (current_inferior): Renamed as... (current_thread): New variable. All uses updated. * linux-low.c (get_pc): Renamed saved_inferior as saved_thread. (maybe_move_out_of_jump_pad): Likewise. (cancel_breakpoint): Likewise. (linux_low_filter_event): Likewise. (wait_for_sigstop): Likewise. (linux_resume_one_lwp): Likewise. (need_step_over_p): Likewise. (start_step_over): Likewise. (linux_stabilize_threads): Renamed save_inferior as saved_thread. * linux-x86-low.c (x86_linux_update_xmltarget): Likewise. * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread and save_inferior as saved_thread. * regcache.c (get_thread_regcache): Renamed saved_inferior as saved_thread. (regcache_invalidate_thread): Likewise. * remote-utils.c (prepare_resume_reply): Likewise. * thread-db.c (thread_db_get_tls_address): Likewise. (disable_thread_event_reporting): Likewise. (remove_thread_event_breakpoints): Likewise. * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior as saved_thread. * target.h (set_desired_inferior): Renamed as... (set_desired_thread): New declaration. All uses updated. * server.c (myresume): Updated comment to reference thread instead of inferior. (handle_serial_event): Likewise. (handle_target_event): Likewise.
Diffstat (limited to 'gdb/gdbserver/tracepoint.c')
-rw-r--r--gdb/gdbserver/tracepoint.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 2e83d71..b6ab53f 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -3979,19 +3979,19 @@ gdb_agent_about_to_close (int pid)
if (!maybe_write_ipa_not_loaded (buf))
{
- struct thread_info *save_inferior;
+ struct thread_info *saved_thread;
- save_inferior = current_inferior;
+ saved_thread = current_thread;
/* Find any thread which belongs to process PID. */
- current_inferior = (struct thread_info *)
+ current_thread = (struct thread_info *)
find_inferior (&all_threads, same_process_p, &pid);
strcpy (buf, "close");
run_inferior_command (buf, strlen (buf) + 1);
- current_inferior = save_inferior;
+ current_thread = saved_thread;
}
}
@@ -4001,7 +4001,7 @@ gdb_agent_about_to_close (int pid)
static void
cmd_qtminftpilen (char *packet)
{
- if (current_inferior == NULL)
+ if (current_thread == NULL)
{
/* Indicate that the minimum length is currently unknown. */
strcpy (packet, "0");
@@ -7259,9 +7259,9 @@ gdb_agent_helper_thread (void *arg)
/* Sleep endlessly to wait the whole inferior stops. This
thread can not exit because GDB or GDBserver may still need
- 'current_inferior' (representing this thread) to access
+ 'current_thread' (representing this thread) to access
inferior memory. Otherwise, this thread exits earlier than
- other threads, and 'current_inferior' is set to NULL. */
+ other threads, and 'current_thread' is set to NULL. */
while (1)
sleep (10);
}