This revision was automatically updated to reflect the committed changes.
Closed by commit rG482a0ad5ba72: [lldb] Improve logging for process state
change (NFC) (authored by mib).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148399/new/
https://reviews.llvm.org/D148399
Files:
lldb/source/Target/Process.cpp
Index: lldb/source/Target/Process.cpp
===================================================================
--- lldb/source/Target/Process.cpp
+++ lldb/source/Target/Process.cpp
@@ -1055,14 +1055,16 @@
std::lock_guard<std::mutex> guard(m_exit_status_mutex);
Log *log(GetLog(LLDBLog::State | LLDBLog::Process));
- LLDB_LOGF(
- log, "Process::SetExitStatus (status=%i (0x%8.8x), description=%s%s%s)",
- status, status, cstr ? "\"" : "", cstr ? cstr : "NULL", cstr ? "\"" : "");
+ LLDB_LOG(log, "(plugin = %s status=%i (0x%8.8x), description=%s%s%s)",
+ GetPluginName().data(), status, status, cstr ? "\"" : "",
+ cstr ? cstr : "NULL", cstr ? "\"" : "");
// We were already in the exited state
if (m_private_state.GetValue() == eStateExited) {
- LLDB_LOGF(log, "Process::SetExitStatus () ignoring exit status because "
- "state was already set to eStateExited");
+ LLDB_LOG(log,
+ "(plugin = %s) ignoring exit status because state was already set "
+ "to eStateExited",
+ GetPluginName().data());
return false;
}
@@ -1314,8 +1316,8 @@
}
Log *log(GetLog(LLDBLog::State | LLDBLog::Process));
- LLDB_LOGF(log, "Process::SetPublicState (state = %s, restarted = %i)",
- StateAsCString(new_state), restarted);
+ LLDB_LOG(log, "(plugin = %s, state = %s, restarted = %i)",
+ GetPluginName().data(), StateAsCString(new_state), restarted);
const StateType old_state = m_public_state.GetValue();
m_public_state.SetValue(new_state);
@@ -1324,16 +1326,16 @@
// program to run.
if (!StateChangedIsExternallyHijacked()) {
if (new_state == eStateDetached) {
- LLDB_LOGF(log,
- "Process::SetPublicState (%s) -- unlocking run lock for detach",
- StateAsCString(new_state));
+ LLDB_LOG(log,
+ "(plugin = %s, state = %s) -- unlocking run lock for detach",
+ GetPluginName().data(), StateAsCString(new_state));
m_public_run_lock.SetStopped();
} else {
const bool old_state_is_stopped = StateIsStoppedState(old_state, false);
if ((old_state_is_stopped != new_state_is_stopped)) {
if (new_state_is_stopped && !restarted) {
- LLDB_LOGF(log, "Process::SetPublicState (%s) -- unlocking run lock",
- StateAsCString(new_state));
+ LLDB_LOG(log, "(plugin = %s, state = %s) -- unlocking run lock",
+ GetPluginName().data(), StateAsCString(new_state));
m_public_run_lock.SetStopped();
}
}
@@ -1343,10 +1345,11 @@
Status Process::Resume() {
Log *log(GetLog(LLDBLog::State | LLDBLog::Process));
- LLDB_LOGF(log, "Process::Resume -- locking run lock");
+ LLDB_LOG(log, "(plugin = %s) -- locking run lock", GetPluginName().data());
if (!m_public_run_lock.TrySetRunning()) {
Status error("Resume request failed - process still running.");
- LLDB_LOGF(log, "Process::Resume: -- TrySetRunning failed, not resuming.");
+ LLDB_LOG(log, "(plugin = %s) -- TrySetRunning failed, not resuming.",
+ GetPluginName().data());
return error;
}
Status error = PrivateResume();
@@ -1419,7 +1422,8 @@
Log *log(GetLog(LLDBLog::State | LLDBLog::Process | LLDBLog::Unwind));
bool state_changed = false;
- LLDB_LOGF(log, "Process::SetPrivateState (%s)", StateAsCString(new_state));
+ LLDB_LOG(log, "(plugin = %s, state = %s)", GetPluginName().data(),
+ StateAsCString(new_state));
std::lock_guard<std::recursive_mutex> thread_guard(m_thread_list.GetMutex());
std::lock_guard<std::recursive_mutex> guard(m_private_state.GetMutex());
@@ -1460,15 +1464,15 @@
if (!m_mod_id.IsLastResumeForUserExpression())
m_mod_id.SetStopEventForLastNaturalStopID(event_sp);
m_memory_cache.Clear();
- LLDB_LOGF(log, "Process::SetPrivateState (%s) stop_id = %u",
- StateAsCString(new_state), m_mod_id.GetStopID());
+ LLDB_LOG(log, "(plugin = %s, state = %s, stop_id = %u",
+ GetPluginName().data(), StateAsCString(new_state),
+ m_mod_id.GetStopID());
}
m_private_state_broadcaster.BroadcastEvent(event_sp);
} else {
- LLDB_LOGF(log,
- "Process::SetPrivateState (%s) state didn't change. Ignoring...",
- StateAsCString(new_state));
+ LLDB_LOG(log, "(plugin = %s, state = %s) state didn't change. Ignoring...",
+ GetPluginName().data(), StateAsCString(new_state));
}
}
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits