Skip to content

Commit 33d5b27

Browse files
committed
[lldb] Fix process LLDB_LOG typo (nfci)
This patch fixes the log commands by replacing the LLDB_LOG macro by the LLDB_LOGF macro. This is necessary in order to format argument with printf. Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent e2b11c2 commit 33d5b27

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lldb/source/Target/Process.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,13 +1174,13 @@ bool Process::SetExitStatus(int status, const char *cstr) {
11741174
std::lock_guard<std::mutex> guard(m_exit_status_mutex);
11751175

11761176
Log *log(GetLog(LLDBLog::State | LLDBLog::Process));
1177-
LLDB_LOG(log, "(plugin = %s status=%i (0x%8.8x), description=%s%s%s)",
1177+
LLDB_LOGF(log, "(plugin = %s status=%i (0x%8.8x), description=%s%s%s)",
11781178
GetPluginName().data(), status, status, cstr ? "\"" : "",
11791179
cstr ? cstr : "NULL", cstr ? "\"" : "");
11801180

11811181
// We were already in the exited state
11821182
if (m_private_state.GetValue() == eStateExited) {
1183-
LLDB_LOG(log,
1183+
LLDB_LOGF(log,
11841184
"(plugin = %s) ignoring exit status because state was already set "
11851185
"to eStateExited",
11861186
GetPluginName().data());
@@ -1467,7 +1467,7 @@ void Process::SetPublicState(StateType new_state, bool restarted) {
14671467
}
14681468

14691469
Log *log(GetLog(LLDBLog::State | LLDBLog::Process));
1470-
LLDB_LOG(log, "(plugin = %s, state = %s, restarted = %i)",
1470+
LLDB_LOGF(log, "(plugin = %s, state = %s, restarted = %i)",
14711471
GetPluginName().data(), StateAsCString(new_state), restarted);
14721472
const StateType old_state = m_public_state.GetValue();
14731473
m_public_state.SetValue(new_state);
@@ -1477,15 +1477,15 @@ void Process::SetPublicState(StateType new_state, bool restarted) {
14771477
// program to run.
14781478
if (!StateChangedIsExternallyHijacked()) {
14791479
if (new_state == eStateDetached) {
1480-
LLDB_LOG(log,
1480+
LLDB_LOGF(log,
14811481
"(plugin = %s, state = %s) -- unlocking run lock for detach",
14821482
GetPluginName().data(), StateAsCString(new_state));
14831483
m_public_run_lock.SetStopped();
14841484
} else {
14851485
const bool old_state_is_stopped = StateIsStoppedState(old_state, false);
14861486
if ((old_state_is_stopped != new_state_is_stopped)) {
14871487
if (new_state_is_stopped && !restarted) {
1488-
LLDB_LOG(log, "(plugin = %s, state = %s) -- unlocking run lock",
1488+
LLDB_LOGF(log, "(plugin = %s, state = %s) -- unlocking run lock",
14891489
GetPluginName().data(), StateAsCString(new_state));
14901490
m_public_run_lock.SetStopped();
14911491
}
@@ -1496,10 +1496,10 @@ void Process::SetPublicState(StateType new_state, bool restarted) {
14961496

14971497
Status Process::Resume() {
14981498
Log *log(GetLog(LLDBLog::State | LLDBLog::Process));
1499-
LLDB_LOG(log, "(plugin = %s) -- locking run lock", GetPluginName().data());
1499+
LLDB_LOGF(log, "(plugin = %s) -- locking run lock", GetPluginName().data());
15001500
if (!m_public_run_lock.TrySetRunning()) {
15011501
Status error("Resume request failed - process still running.");
1502-
LLDB_LOG(log, "(plugin = %s) -- TrySetRunning failed, not resuming.",
1502+
LLDB_LOGF(log, "(plugin = %s) -- TrySetRunning failed, not resuming.",
15031503
GetPluginName().data());
15041504
return error;
15051505
}
@@ -1573,7 +1573,7 @@ void Process::SetPrivateState(StateType new_state) {
15731573
Log *log(GetLog(LLDBLog::State | LLDBLog::Process | LLDBLog::Unwind));
15741574
bool state_changed = false;
15751575

1576-
LLDB_LOG(log, "(plugin = %s, state = %s)", GetPluginName().data(),
1576+
LLDB_LOGF(log, "(plugin = %s, state = %s)", GetPluginName().data(),
15771577
StateAsCString(new_state));
15781578

15791579
std::lock_guard<std::recursive_mutex> thread_guard(m_thread_list.GetMutex());
@@ -1615,14 +1615,14 @@ void Process::SetPrivateState(StateType new_state) {
16151615
if (!m_mod_id.IsLastResumeForUserExpression())
16161616
m_mod_id.SetStopEventForLastNaturalStopID(event_sp);
16171617
m_memory_cache.Clear();
1618-
LLDB_LOG(log, "(plugin = %s, state = %s, stop_id = %u",
1618+
LLDB_LOGF(log, "(plugin = %s, state = %s, stop_id = %u",
16191619
GetPluginName().data(), StateAsCString(new_state),
16201620
m_mod_id.GetStopID());
16211621
}
16221622

16231623
m_private_state_broadcaster.BroadcastEvent(event_sp);
16241624
} else {
1625-
LLDB_LOG(log, "(plugin = %s, state = %s) state didn't change. Ignoring...",
1625+
LLDB_LOGF(log, "(plugin = %s, state = %s) state didn't change. Ignoring...",
16261626
GetPluginName().data(), StateAsCString(new_state));
16271627
}
16281628
}

0 commit comments

Comments
 (0)