std::string name;
int core = -1;
+ /* Only used when not in non-stop mode. Set to true when a stop is
+ requested for the thread. */
+ bool stop_requested = false;
+
/* Thread handle, perhaps a pthread_t or thread_t value, stored as a
sequence of bytes. */
gdb::byte_vector thread_handle;
/* We don't currently have a way to transparently pause the
remote target in all-stop mode. Interrupt it instead. */
remote_interrupt_as ();
+
+ /* Record that this thread's stop is a result of GDB asking for the
+ stop, rather than the user asking for an interrupt. We can use
+ this information to adjust the waitstatus when it arrives. */
+ remote_thread_info *remote_thr = get_remote_thread_info (this, ptid);
+ remote_thr->stop_requested = true;
}
}
/* If the target works in non-stop mode, a stop-reply indicates that
only this thread stopped. */
remote_thr->set_not_resumed ();
+ gdb_assert (!remote_thr->stop_requested);
}
else
{
+ if (status->kind () == TARGET_WAITKIND_STOPPED
+ && status->sig () == GDB_SIGNAL_INT
+ && remote_thr->stop_requested)
+ status->set_stopped (GDB_SIGNAL_0);
+ remote_thr->stop_requested = false;
+
/* If the target works in all-stop mode, a stop-reply indicates that
all the target's threads stopped. */
for (thread_info *tp : all_non_exited_threads (this))
gdb_test_no_output "set direct-call-timeout 5"
- # When non-stop mode is off we get slightly different output from GDB.
- if { [gdb_is_remote_or_extended_remote_target] && $target_non_stop == "off" } {
- set stopped_line_pattern "Program received signal SIGINT, Interrupt\\."
- } else {
- set stopped_line_pattern "Program stopped\\."
- }
-
gdb_test "print function_that_never_returns ()" \
[multi_line \
- $stopped_line_pattern \
+ "Program stopped\\." \
".*" \
"The program being debugged timed out while in a function called from GDB\\." \
"GDB remains in the frame where the timeout occurred\\." \
"get number for segfault breakpoint"]
}
- # When non-stop mode is off we get slightly different output from GDB.
- if { [gdb_is_remote_or_extended_remote_target] && $target_non_stop == "off" } {
- set stopped_line_pattern "Thread ${::decimal} \"\[^\r\n\"\]+\" received signal SIGINT, Interrupt\\."
- } else {
- set stopped_line_pattern "Thread ${::decimal} \"\[^\r\n\"\]+\" stopped\\."
- }
-
gdb_test "continue" \
[multi_line \
- $stopped_line_pattern \
+ "Thread ${::decimal} \"\[^\r\n\"\]+\" stopped\\." \
".*" \
"Error in testing condition for breakpoint ${bp_num}:" \
"The program being debugged timed out while in a function called from GDB\\." \