forked from OSchip/llvm-project
[lldb/gdb-remote] Remove last_stop_packet_mutex
This is a remnant of the non-stop mode.
This commit is contained in:
parent
6cffc35746
commit
f6e3abc530
|
@ -251,8 +251,7 @@ bool ProcessGDBRemote::CanDebug(lldb::TargetSP target_sp,
|
||||||
ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp,
|
ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp,
|
||||||
ListenerSP listener_sp)
|
ListenerSP listener_sp)
|
||||||
: Process(target_sp, listener_sp),
|
: Process(target_sp, listener_sp),
|
||||||
m_debugserver_pid(LLDB_INVALID_PROCESS_ID), m_last_stop_packet_mutex(),
|
m_debugserver_pid(LLDB_INVALID_PROCESS_ID), m_register_info_sp(nullptr),
|
||||||
m_register_info_sp(nullptr),
|
|
||||||
m_async_broadcaster(nullptr, "lldb.process.gdb-remote.async-broadcaster"),
|
m_async_broadcaster(nullptr, "lldb.process.gdb-remote.async-broadcaster"),
|
||||||
m_async_listener_sp(
|
m_async_listener_sp(
|
||||||
Listener::MakeListener("lldb.process.gdb-remote.async-listener")),
|
Listener::MakeListener("lldb.process.gdb-remote.async-listener")),
|
||||||
|
@ -1462,16 +1461,10 @@ bool ProcessGDBRemote::UpdateThreadIDList() {
|
||||||
// See if we can get the thread IDs from the current stop reply packets
|
// See if we can get the thread IDs from the current stop reply packets
|
||||||
// that might contain a "threads" key/value pair
|
// that might contain a "threads" key/value pair
|
||||||
|
|
||||||
// Lock the thread stack while we access it
|
|
||||||
// Mutex::Locker stop_stack_lock(m_last_stop_packet_mutex);
|
|
||||||
std::unique_lock<std::recursive_mutex> stop_stack_lock(
|
|
||||||
m_last_stop_packet_mutex, std::defer_lock);
|
|
||||||
if (stop_stack_lock.try_lock()) {
|
|
||||||
if (m_last_stop_packet) {
|
if (m_last_stop_packet) {
|
||||||
// Get the thread stop info
|
// Get the thread stop info
|
||||||
StringExtractorGDBRemote &stop_info = *m_last_stop_packet;
|
StringExtractorGDBRemote &stop_info = *m_last_stop_packet;
|
||||||
const std::string &stop_info_str =
|
const std::string &stop_info_str = std::string(stop_info.GetStringRef());
|
||||||
std::string(stop_info.GetStringRef());
|
|
||||||
|
|
||||||
m_thread_pcs.clear();
|
m_thread_pcs.clear();
|
||||||
const size_t thread_pcs_pos = stop_info_str.find(";thread-pcs:");
|
const size_t thread_pcs_pos = stop_info_str.find(";thread-pcs:");
|
||||||
|
@ -1496,7 +1489,6 @@ bool ProcessGDBRemote::UpdateThreadIDList() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool sequence_mutex_unavailable = false;
|
bool sequence_mutex_unavailable = false;
|
||||||
m_gdb_comm.GetCurrentThreadIDs(m_thread_ids, sequence_mutex_unavailable);
|
m_gdb_comm.GetCurrentThreadIDs(m_thread_ids, sequence_mutex_unavailable);
|
||||||
|
@ -2317,14 +2309,9 @@ void ProcessGDBRemote::RefreshStateAfterStop() {
|
||||||
// date before we do that or we might overwrite what was computed here.
|
// date before we do that or we might overwrite what was computed here.
|
||||||
UpdateThreadListIfNeeded();
|
UpdateThreadListIfNeeded();
|
||||||
|
|
||||||
// Scope for the lock
|
|
||||||
{
|
|
||||||
// Lock the thread stack while we access it
|
|
||||||
std::lock_guard<std::recursive_mutex> guard(m_last_stop_packet_mutex);
|
|
||||||
if (m_last_stop_packet)
|
if (m_last_stop_packet)
|
||||||
SetThreadStopInfo(*m_last_stop_packet);
|
SetThreadStopInfo(*m_last_stop_packet);
|
||||||
m_last_stop_packet.reset();
|
m_last_stop_packet.reset();
|
||||||
}
|
|
||||||
|
|
||||||
// If we have queried for a default thread id
|
// If we have queried for a default thread id
|
||||||
if (m_initial_tid != LLDB_INVALID_THREAD_ID) {
|
if (m_initial_tid != LLDB_INVALID_THREAD_ID) {
|
||||||
|
@ -2571,14 +2558,8 @@ void ProcessGDBRemote::SetLastStopPacket(
|
||||||
m_gdb_comm.ResetDiscoverableSettings(did_exec);
|
m_gdb_comm.ResetDiscoverableSettings(did_exec);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scope the lock
|
|
||||||
{
|
|
||||||
// Lock the thread stack while we access it
|
|
||||||
std::lock_guard<std::recursive_mutex> guard(m_last_stop_packet_mutex);
|
|
||||||
|
|
||||||
m_last_stop_packet = response;
|
m_last_stop_packet = response;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ProcessGDBRemote::SetUnixSignals(const UnixSignalsSP &signals_sp) {
|
void ProcessGDBRemote::SetUnixSignals(const UnixSignalsSP &signals_sp) {
|
||||||
Process::SetUnixSignals(std::make_shared<GDBRemoteSignals>(signals_sp));
|
Process::SetUnixSignals(std::make_shared<GDBRemoteSignals>(signals_sp));
|
||||||
|
|
Loading…
Reference in New Issue