Skip to content

Commit ebf9882

Browse files
committed
[lldb] Fix incorrect uses of formatv specifiers in LLDB_LOG
Fix incorrect uses of formatv specifiers in LLDB_LOG. Unlike Python, arguments must be numbered. All the affected log statements take llvm:Errors so use the LLDB_LOG_ERROR macro instead. Differential revision: https://reviews.llvm.org/D154532 (cherry picked from commit 520681e)
1 parent 9c0784e commit ebf9882

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

lldb/source/API/SBTarget.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,8 +1153,8 @@ bool SBTarget::FindBreakpointsByName(const char *name,
11531153
llvm::Expected<std::vector<BreakpointSP>> expected_vector =
11541154
target_sp->GetBreakpointList().FindBreakpointsByName(name);
11551155
if (!expected_vector) {
1156-
LLDB_LOG(GetLog(LLDBLog::Breakpoints), "invalid breakpoint name: {}",
1157-
llvm::toString(expected_vector.takeError()));
1156+
LLDB_LOG_ERROR(GetLog(LLDBLog::Breakpoints), expected_vector.takeError(),
1157+
"invalid breakpoint name: {0}");
11581158
return false;
11591159
}
11601160
for (BreakpointSP bkpt_sp : *expected_vector) {
@@ -1627,7 +1627,7 @@ const char *SBTarget::GetTriple() {
16271627

16281628
const char *SBTarget::GetABIName() {
16291629
LLDB_INSTRUMENT_VA(this);
1630-
1630+
16311631
TargetSP target_sp(GetSP());
16321632
if (target_sp) {
16331633
std::string abi_name(target_sp->GetABIName().str());

lldb/source/Core/Debugger.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1880,8 +1880,8 @@ bool Debugger::StartEventHandlerThread() {
18801880
if (event_handler_thread) {
18811881
m_event_handler_thread = *event_handler_thread;
18821882
} else {
1883-
LLDB_LOG(GetLog(LLDBLog::Host), "failed to launch host thread: {}",
1884-
llvm::toString(event_handler_thread.takeError()));
1883+
LLDB_LOG_ERROR(GetLog(LLDBLog::Host), event_handler_thread.takeError(),
1884+
"failed to launch host thread: {0}");
18851885
}
18861886

18871887
// Make sure DefaultEventHandler() is running and listening to events
@@ -2021,8 +2021,8 @@ bool Debugger::StartIOHandlerThread() {
20212021
if (io_handler_thread) {
20222022
m_io_handler_thread = *io_handler_thread;
20232023
} else {
2024-
LLDB_LOG(GetLog(LLDBLog::Host), "failed to launch host thread: {}",
2025-
llvm::toString(io_handler_thread.takeError()));
2024+
LLDB_LOG_ERROR(GetLog(LLDBLog::Host), io_handler_thread.takeError(),
2025+
"failed to launch host thread: {0}");
20262026
}
20272027
}
20282028
return m_io_handler_thread.IsJoinable();

lldb/source/Core/ThreadedCommunication.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ bool ThreadedCommunication::StartReadThread(Status *error_ptr) {
178178
if (error_ptr)
179179
*error_ptr = Status(maybe_thread.takeError());
180180
else {
181-
LLDB_LOG(GetLog(LLDBLog::Host), "failed to launch host thread: {}",
182-
llvm::toString(maybe_thread.takeError()));
181+
LLDB_LOG_ERROR(GetLog(LLDBLog::Host), maybe_thread.takeError(),
182+
"failed to launch host thread: {0}");
183183
}
184184
}
185185

lldb/source/Host/common/ProcessLaunchInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ bool ProcessLaunchInfo::MonitorProcess() const {
182182
llvm::Expected<HostThread> maybe_thread =
183183
Host::StartMonitoringChildProcess(m_monitor_callback, GetProcessID());
184184
if (!maybe_thread)
185-
LLDB_LOG(GetLog(LLDBLog::Host), "failed to launch host thread: {}",
186-
llvm::toString(maybe_thread.takeError()));
185+
LLDB_LOG_ERROR(GetLog(LLDBLog::Host), maybe_thread.takeError(),
186+
"failed to launch host thread: {0}");
187187
return true;
188188
}
189189
return false;

lldb/source/Target/Process.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3746,8 +3746,8 @@ bool Process::StartPrivateStateThread(bool is_secondary_thread) {
37463746
},
37473747
8 * 1024 * 1024);
37483748
if (!private_state_thread) {
3749-
LLDB_LOG(GetLog(LLDBLog::Host), "failed to launch host thread: {}",
3750-
llvm::toString(private_state_thread.takeError()));
3749+
LLDB_LOG_ERROR(GetLog(LLDBLog::Host), private_state_thread.takeError(),
3750+
"failed to launch host thread: {0}");
37513751
return false;
37523752
}
37533753

0 commit comments

Comments
 (0)