diff options
author | Gary Benson <gbenson@redhat.com> | 2014-09-10 10:37:11 +0100 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2014-09-16 15:57:13 +0100 |
commit | 0bfdf32fa101021ad0d11dd3ae945c823f4b07ac (patch) | |
tree | 8789d5ff75836459b77f6ae88ff06ada3b6c300c /gdb/gdbserver/lynx-low.c | |
parent | 635856f584de7af4b21bb72688c05cd6d9a0aec6 (diff) | |
download | gdb-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/lynx-low.c')
-rw-r--r-- | gdb/gdbserver/lynx-low.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/gdbserver/lynx-low.c b/gdb/gdbserver/lynx-low.c index 0b0ff47..96dea03 100644 --- a/gdb/gdbserver/lynx-low.c +++ b/gdb/gdbserver/lynx-low.c @@ -338,9 +338,9 @@ lynx_resume (struct thread_resume *resume_info, size_t n) /* The ptid might still be minus_one_ptid; this can happen between the moment we create the inferior or attach to a process, and the moment we resume its execution for the first time. It is - fine to use the current_inferior's ptid in those cases. */ + fine to use the current_thread's ptid in those cases. */ if (ptid_equal (ptid, minus_one_ptid)) - ptid = thread_to_gdb_id (current_inferior); + ptid = thread_to_gdb_id (current_thread); regcache_invalidate (); @@ -413,7 +413,7 @@ lynx_wait_1 (ptid_t ptid, struct target_waitstatus *status, int options) ptid_t new_ptid; if (ptid_equal (ptid, minus_one_ptid)) - pid = lynx_ptid_get_pid (thread_to_gdb_id (current_inferior)); + pid = lynx_ptid_get_pid (thread_to_gdb_id (current_thread)); else pid = BUILDPID (lynx_ptid_get_pid (ptid), lynx_ptid_get_tid (ptid)); @@ -582,7 +582,7 @@ static void lynx_fetch_registers (struct regcache *regcache, int regno) { struct lynx_regset_info *regset = lynx_target_regsets; - ptid_t inferior_ptid = thread_to_gdb_id (current_inferior); + ptid_t inferior_ptid = thread_to_gdb_id (current_thread); lynx_debug ("lynx_fetch_registers (regno = %d)", regno); @@ -607,7 +607,7 @@ static void lynx_store_registers (struct regcache *regcache, int regno) { struct lynx_regset_info *regset = lynx_target_regsets; - ptid_t inferior_ptid = thread_to_gdb_id (current_inferior); + ptid_t inferior_ptid = thread_to_gdb_id (current_thread); lynx_debug ("lynx_store_registers (regno = %d)", regno); @@ -643,7 +643,7 @@ lynx_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) int buf; const int xfer_size = sizeof (buf); CORE_ADDR addr = memaddr & -(CORE_ADDR) xfer_size; - ptid_t inferior_ptid = thread_to_gdb_id (current_inferior); + ptid_t inferior_ptid = thread_to_gdb_id (current_thread); while (addr < memaddr + len) { @@ -676,7 +676,7 @@ lynx_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len) int buf; const int xfer_size = sizeof (buf); CORE_ADDR addr = memaddr & -(CORE_ADDR) xfer_size; - ptid_t inferior_ptid = thread_to_gdb_id (current_inferior); + ptid_t inferior_ptid = thread_to_gdb_id (current_thread); while (addr < memaddr + len) { @@ -710,7 +710,7 @@ lynx_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len) static void lynx_request_interrupt (void) { - ptid_t inferior_ptid = thread_to_gdb_id (current_inferior); + ptid_t inferior_ptid = thread_to_gdb_id (current_thread); kill (lynx_ptid_get_pid (inferior_ptid), SIGINT); } |