From 256761b146e74753c259d7c74e074f05c013ad26 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Mon, 14 Oct 2024 07:02:02 -0700 Subject: [PATCH 1/3] [lldb] Make the system log a NOOP on Windows (#112052) Windows doesn't have a built-in system log. Previously we got away with writing to stdout and stderr because it was used only sporadically. As we're trying to make the system log more useful on the other platforms, the increased use become a concern. Make it a NOOP until someone figures out a reasonable alternative. (cherry picked from commit 3dedcab6d9b660a690d8fe5ddad3d43276a82708) --- lldb/source/Host/common/Host.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp index 01fada13fae53..bb39595fdb8d0 100644 --- a/lldb/source/Host/common/Host.cpp +++ b/lldb/source/Host/common/Host.cpp @@ -111,17 +111,7 @@ void Host::SystemLog(Severity severity, llvm::StringRef message) { syslog(level, "%s", message.data()); } #else -void Host::SystemLog(Severity severity, llvm::StringRef message) { - switch (severity) { - case lldb::eSeverityInfo: - case lldb::eSeverityWarning: - llvm::outs() << message; - break; - case lldb::eSeverityError: - llvm::errs() << message; - break; - } -} +void Host::SystemLog(Severity severity, llvm::StringRef message) {} #endif #endif From e3b64e374ab8fdd8a0c32f01a04deca8b0b63917 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Tue, 15 Oct 2024 16:07:17 -0700 Subject: [PATCH 2/3] [lldb] Make the system log a NOOP on non-Darwin platforms As discussed in #111911, we have consensus that as it stands, the system log is only meaningful on Darwin and that by default it should be a NOOP on other platforms. (cherry picked from commit cc13d4fb4a208363ed1dab29829cd200a3e39c52) --- lldb/source/Host/common/Host.cpp | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp index bb39595fdb8d0..fd5cc1d17da25 100644 --- a/lldb/source/Host/common/Host.cpp +++ b/lldb/source/Host/common/Host.cpp @@ -89,31 +89,12 @@ using namespace lldb; using namespace lldb_private; #if !defined(__APPLE__) -#if !defined(_WIN32) -#include -void Host::SystemLog(Severity severity, llvm::StringRef message) { - static llvm::once_flag g_openlog_once; - llvm::call_once(g_openlog_once, [] { - openlog("lldb", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_USER); - }); - int level = LOG_DEBUG; - switch (severity) { - case lldb::eSeverityInfo: - level = LOG_INFO; - break; - case lldb::eSeverityWarning: - level = LOG_WARNING; - break; - case lldb::eSeverityError: - level = LOG_ERR; - break; - } - syslog(level, "%s", message.data()); -} -#else +// The system log is currently only meaningful on Darwin, where this means +// os_log. The meaning of a "system log" isn't as clear on other platforms, and +// therefore we don't providate a default implementation. Vendors are free to +// to implement this function if they have a use for it. void Host::SystemLog(Severity severity, llvm::StringRef message) {} #endif -#endif #if !defined(__APPLE__) && !defined(_WIN32) static thread_result_t From 8786c475f3cc47b7db1eabda76c97c15469dfce2 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 19 Sep 2025 09:15:12 -0700 Subject: [PATCH 3/3] Revert "[windows][lldb] re-add failing tests to expected failures" This reverts commit 53aa2dc3720cbc5ef426f633ac956b55f9d83aae. --- lldb/test/windows-swift-llvm-lit-test-overrides.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/lldb/test/windows-swift-llvm-lit-test-overrides.txt b/lldb/test/windows-swift-llvm-lit-test-overrides.txt index b5fec12ce2aed..f1d8857d06d35 100644 --- a/lldb/test/windows-swift-llvm-lit-test-overrides.txt +++ b/lldb/test/windows-swift-llvm-lit-test-overrides.txt @@ -10,7 +10,6 @@ xfail lldb-api :: lang/cpp/unique-types4/TestUniqueTypes4.py xfail lldb-shell :: Recognizer/verbose_trap.test -xfail lldb-shell :: Settings/TestEchoCommands.test xfail lldb-shell :: Swift/MissingVFSOverlay.test xfail lldb-shell :: Swift/No.swiftmodule.test xfail lldb-shell :: Swift/ToolchainMismatch.test @@ -25,7 +24,6 @@ xfail lldb-shell :: SwiftREPL/OpenClass.test xfail lldb-shell :: SwiftREPL/OptionalUnowned.test xfail lldb-shell :: SwiftREPL/RedirectInputUnreadable.test xfail lldb-shell :: SwiftREPL/SwiftInterface.test -xfail lldb-shell :: SymbolFile/DWARF/x86/dead-code-filtering.yaml ### Tests that pass locally, but fail in CI reliably ###