forked from Imagelibrary/binutils-gdb
Use "switch_to_thread" more thoroughly on gdbserver
This is a technical debt that I left when I ported "switch_to_thread" to gdbserver. It's a simple patch that converts occurences of: current_thread = find_thread_ptid (ptid); to: switch_to_thread (ptid); This patch also converts a simple "if" to a "gdb_assert" on gdbserver's version of "switch_to_thread": gdb_assert (ptid != minus_one_ptid); This change makes the code more similar to what GDB already does. Regtested on BuildBot. gdb/gdbserver/ChangeLog: 2017-09-26 Sergio Durigan Junior <sergiodj@redhat.com> * gdbthread.h: Include "common-gdbthread.h". * inferiors.c (switch_to_thread): Use "gdb_assert" instead of "if" when validating the ptid. * remote-utils.c: Include "gdbthread.h". (prepare_resume_reply): Use "switch_to_thread". * target.c (done_accessing_memory): Likewise.
This commit is contained in:
@@ -138,7 +138,7 @@ done_accessing_memory (void)
|
||||
|
||||
/* Restore the previous selected thread. */
|
||||
general_thread = prev_general_thread;
|
||||
current_thread = find_thread_ptid (general_thread);
|
||||
switch_to_thread (general_thread);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user