Skip to content

Commit 926d283

Browse files
committed
[lldb-server] Use LLDB_LOG_ERROR to consume Error<> even if logging is disabled
Differential Revision: https://reviews.llvm.org/D70386
1 parent d044dcc commit 926d283

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ bool GDBRemoteCommunicationReplayServer::StartAsyncThread() {
211211
"<lldb.gdb-replay.async>",
212212
GDBRemoteCommunicationReplayServer::AsyncThread, this);
213213
if (!async_thread) {
214-
LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST),
215-
"failed to launch host thread: {}",
216-
llvm::toString(async_thread.takeError()));
214+
LLDB_LOG_ERROR(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST),
215+
async_thread.takeError(),
216+
"failed to launch host thread: {}");
217217
return false;
218218
}
219219
m_async_thread = *async_thread;

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -669,9 +669,9 @@ GDBRemoteCommunicationServerLLGS::SendStopReplyPacketForThread(
669669
response.PutStringAsRawHex8(unescaped_response.GetData());
670670
response.PutChar(';');
671671
} else {
672-
LLDB_LOG(log, "failed to prepare a jstopinfo field for pid {0}:",
673-
m_debugged_process_up->GetID(),
674-
llvm::toString(threads_info.takeError()));
672+
LLDB_LOG_ERROR(log, threads_info.takeError(),
673+
"failed to prepare a jstopinfo field for pid {1}: {0}",
674+
m_debugged_process_up->GetID());
675675
}
676676
}
677677

@@ -3087,9 +3087,9 @@ GDBRemoteCommunicationServerLLGS::Handle_jThreadsInfo(
30873087
llvm::Expected<json::Value> threads_info = GetJSONThreadsInfo(
30883088
*m_debugged_process_up, threads_with_valid_stop_info_only);
30893089
if (!threads_info) {
3090-
LLDB_LOG(log, "failed to prepare a packet for pid {0}: {1}",
3091-
m_debugged_process_up->GetID(),
3092-
llvm::toString(threads_info.takeError()));
3090+
LLDB_LOG_ERROR(log, threads_info.takeError(),
3091+
"failed to prepare a packet for pid {1}: {0}",
3092+
m_debugged_process_up->GetID());
30933093
return SendErrorResponse(52);
30943094
}
30953095

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3635,9 +3635,9 @@ bool ProcessGDBRemote::StartAsyncThread() {
36353635
llvm::Expected<HostThread> async_thread = ThreadLauncher::LaunchThread(
36363636
"<lldb.process.gdb-remote.async>", ProcessGDBRemote::AsyncThread, this);
36373637
if (!async_thread) {
3638-
LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST),
3639-
"failed to launch host thread: {}",
3640-
llvm::toString(async_thread.takeError()));
3638+
LLDB_LOG_ERROR(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST),
3639+
async_thread.takeError(),
3640+
"failed to launch host thread: {}");
36413641
return false;
36423642
}
36433643
m_async_thread = *async_thread;

0 commit comments

Comments
 (0)