+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.
+
2017-09-25 Andreas Arnez <arnez@linux.vnet.ibm.com>
* configure.srv (s390*-*-linux*): Add s390-gs-linux64.o and
#ifndef GDB_THREAD_H
#define GDB_THREAD_H
+#include "common-gdbthread.h"
#include "inferiors.h"
struct btrace_target_info;
void
switch_to_thread (ptid_t ptid)
{
- if (!ptid_equal (ptid, minus_one_ptid))
- current_thread = find_thread_ptid (ptid);
+ gdb_assert (ptid != minus_one_ptid);
+ current_thread = find_thread_ptid (ptid);
}
#include "tdesc.h"
#include "dll.h"
#include "rsp-low.h"
+#include "gdbthread.h"
#include <ctype.h>
#if HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
saved_thread = current_thread;
- current_thread = find_thread_ptid (ptid);
+ switch_to_thread (ptid);
regp = current_target_desc ()->expedite_regs;
/* Restore the previous selected thread. */
general_thread = prev_general_thread;
- current_thread = find_thread_ptid (general_thread);
+ switch_to_thread (general_thread);
}
int