Skip to content

Commit ac09a0e

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 1370a1c commit ac09a0e

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
@@ -1056,13 +1056,13 @@ bool Process::SetExitStatus(int status, const char *cstr) {
10561056
std::lock_guard<std::mutex> guard(m_exit_status_mutex);
10571057

10581058
Log *log(GetLog(LLDBLog::State | LLDBLog::Process));
1059-
LLDB_LOG(log, "(plugin = %s status=%i (0x%8.8x), description=%s%s%s)",
1059+
LLDB_LOGF(log, "(plugin = %s status=%i (0x%8.8x), description=%s%s%s)",
10601060
GetPluginName().data(), status, status, cstr ? "\"" : "",
10611061
cstr ? cstr : "NULL", cstr ? "\"" : "");
10621062

10631063
// We were already in the exited state
10641064
if (m_private_state.GetValue() == eStateExited) {
1065-
LLDB_LOG(log,
1065+
LLDB_LOGF(log,
10661066
"(plugin = %s) ignoring exit status because state was already set "
10671067
"to eStateExited",
10681068
GetPluginName().data());
@@ -1317,7 +1317,7 @@ void Process::SetPublicState(StateType new_state, bool restarted) {
13171317
}
13181318

13191319
Log *log(GetLog(LLDBLog::State | LLDBLog::Process));
1320-
LLDB_LOG(log, "(plugin = %s, state = %s, restarted = %i)",
1320+
LLDB_LOGF(log, "(plugin = %s, state = %s, restarted = %i)",
13211321
GetPluginName().data(), StateAsCString(new_state), restarted);
13221322
const StateType old_state = m_public_state.GetValue();
13231323
m_public_state.SetValue(new_state);
@@ -1327,15 +1327,15 @@ void Process::SetPublicState(StateType new_state, bool restarted) {
13271327
// program to run.
13281328
if (!StateChangedIsExternallyHijacked()) {
13291329
if (new_state == eStateDetached) {
1330-
LLDB_LOG(log,
1330+
LLDB_LOGF(log,
13311331
"(plugin = %s, state = %s) -- unlocking run lock for detach",
13321332
GetPluginName().data(), StateAsCString(new_state));
13331333
m_public_run_lock.SetStopped();
13341334
} else {
13351335
const bool old_state_is_stopped = StateIsStoppedState(old_state, false);
13361336
if ((old_state_is_stopped != new_state_is_stopped)) {
13371337
if (new_state_is_stopped && !restarted) {
1338-
LLDB_LOG(log, "(plugin = %s, state = %s) -- unlocking run lock",
1338+
LLDB_LOGF(log, "(plugin = %s, state = %s) -- unlocking run lock",
13391339
GetPluginName().data(), StateAsCString(new_state));
13401340
m_public_run_lock.SetStopped();
13411341
}
@@ -1346,10 +1346,10 @@ void Process::SetPublicState(StateType new_state, bool restarted) {
13461346

13471347
Status Process::Resume() {
13481348
Log *log(GetLog(LLDBLog::State | LLDBLog::Process));
1349-
LLDB_LOG(log, "(plugin = %s) -- locking run lock", GetPluginName().data());
1349+
LLDB_LOGF(log, "(plugin = %s) -- locking run lock", GetPluginName().data());
13501350
if (!m_public_run_lock.TrySetRunning()) {
13511351
Status error("Resume request failed - process still running.");
1352-
LLDB_LOG(log, "(plugin = %s) -- TrySetRunning failed, not resuming.",
1352+
LLDB_LOGF(log, "(plugin = %s) -- TrySetRunning failed, not resuming.",
13531353
GetPluginName().data());
13541354
return error;
13551355
}
@@ -1423,7 +1423,7 @@ void Process::SetPrivateState(StateType new_state) {
14231423
Log *log(GetLog(LLDBLog::State | LLDBLog::Process | LLDBLog::Unwind));
14241424
bool state_changed = false;
14251425

1426-
LLDB_LOG(log, "(plugin = %s, state = %s)", GetPluginName().data(),
1426+
LLDB_LOGF(log, "(plugin = %s, state = %s)", GetPluginName().data(),
14271427
StateAsCString(new_state));
14281428

14291429
std::lock_guard<std::recursive_mutex> thread_guard(m_thread_list.GetMutex());
@@ -1465,14 +1465,14 @@ void Process::SetPrivateState(StateType new_state) {
14651465
if (!m_mod_id.IsLastResumeForUserExpression())
14661466
m_mod_id.SetStopEventForLastNaturalStopID(event_sp);
14671467
m_memory_cache.Clear();
1468-
LLDB_LOG(log, "(plugin = %s, state = %s, stop_id = %u",
1468+
LLDB_LOGF(log, "(plugin = %s, state = %s, stop_id = %u",
14691469
GetPluginName().data(), StateAsCString(new_state),
14701470
m_mod_id.GetStopID());
14711471
}
14721472

14731473
m_private_state_broadcaster.BroadcastEvent(event_sp);
14741474
} else {
1475-
LLDB_LOG(log, "(plugin = %s, state = %s) state didn't change. Ignoring...",
1475+
LLDB_LOGF(log, "(plugin = %s, state = %s) state didn't change. Ignoring...",
14761476
GetPluginName().data(), StateAsCString(new_state));
14771477
}
14781478
}

0 commit comments

Comments
 (0)