+2021-02-25 Jan Matyas <jmatyas@codasip.com>
+
+ PR gdb/26819
+ * remote.c (remote_target::start_remote): Ensure the single
+ thread, automatically added for remote targets without the
+ concept of threading, is initially in set to the "resumed"
+ state.
+ * remote.c (remote_target::add_current_inferior_and_thread):
+ Add return value - return the main thread.
+
2021-02-25 Jan Vrany <jan.vrany@labware.com>
* gdb/mi/mi-interp.c (mi_traceframe_changed): Remove trailing \n from output.
int remote_resume_with_vcont (ptid_t ptid, int step,
gdb_signal siggnal);
- void add_current_inferior_and_thread (const char *wait_status);
+ thread_info *add_current_inferior_and_thread (const char *wait_status);
ptid_t wait_ns (ptid_t ptid, struct target_waitstatus *status,
target_wait_flags options);
whose response is a stop reply from which we can also try
extracting the thread. If the target doesn't support the explicit
qC query, we infer the current thread from that stop reply, passed
- in in WAIT_STATUS, which may be NULL. */
+ in in WAIT_STATUS, which may be NULL.
-void
+ The function returns pointer to the main thread of the inferior. */
+
+thread_info *
remote_target::add_current_inferior_and_thread (const char *wait_status)
{
struct remote_state *rs = get_remote_state ();
yet. */
thread_info *tp = add_thread_silent (this, curr_ptid);
switch_to_thread_no_regs (tp);
+
+ return tp;
}
/* Print info about a thread that was found already stopped on
/* Target has no concept of threads at all. GDB treats
non-threaded target as single-threaded; add a main
thread. */
- add_current_inferior_and_thread (wait_status);
+ thread_info *tp = add_current_inferior_and_thread (wait_status);
+ get_remote_thread_info (tp)->set_resumed ();
}
else
{
+2021-02-25 Jan Matyas <jmatyas@codasip.com>
+
+ PR gdb/26819
+ * gdb.server/stop-reply-no-thread.exp: Add two test
+ scenarios that cover remote targets which do not have
+ the concept of threads.
+
2021-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.fortran/associated.exp: Add missing '-wrap' argument.
run_test $to_disable $t_nonstop
}
}
+
+# Regression for PR gdb/26819: Cover the case when GDBserver does not report
+# any threads (i.e. the remote target has no concept of threads).
+#
+# Scenario 1: Disable 'T' and 'qfThreadInfo' packets
+# Scenario 2: Disable all threading packets
+foreach_with_prefix to_disable { "T,qfThreadInfo" "threads" } {
+ # Non-stop mode not applicable - off.
+ run_test $to_disable off
+}