Skip to content

[lldb] Make the system log a NOOP on Windows #112052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

JDevlieghere
Copy link
Member

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.

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.
@JDevlieghere JDevlieghere requested a review from labath October 11, 2024 21:48
@llvmbot llvmbot added the lldb label Oct 11, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 11, 2024

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/112052.diff

1 Files Affected:

  • (modified) lldb/source/Host/common/Host.cpp (+1-11)
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index f08adea6546ae1..b7d9725d378d0c 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
 

@grandinj
Copy link

@DavidSpickett
Copy link
Collaborator

I wonder if this is going to fix https://lab.llvm.org/buildbot/#/builders/141/builds/3100, so I am testing it right now.

c:\users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\filecheck.exe  C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\test\Shell\Settings/Inputs/EchoCommandsQuiet.out <C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\tools\lldb\test\Shell\Settings\Output\TestEchoCommandsQuiet.test.tmp.file
# executed command: 'c:\users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\filecheck.exe' 'C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\test\Shell\Settings/Inputs/EchoCommandsQuiet.out'
# .---command stderr------------
# | C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\test\Shell\Settings/Inputs/EchoCommandsQuiet.out:4:13: error: CHECK-NEXT: is not on the line after the previous match
# | CHECK-NEXT: done
# |             ^
# | <stdin>:5:1: note: 'next' match was here
# | done
# | ^
# | <stdin>:1:6: note: previous match ended here
# | start
# |      ^
# | <stdin>:2:1: note: non-matching line after previous match is here
# | lldb version 20.0.0git (https://github.com/llvm/llvm-project.git revision 73e74e496ec32a13a5ae71df71364065f7be3cca)
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\test\Shell\Settings/Inputs/EchoCommandsQuiet.out
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |         1: start 
# |         2: lldb version 20.0.0git (https://github.com/llvm/llvm-project.git revision 73e74e496ec32a13a5ae71df71364065f7be3cca) 
# |         3:  clang revision 73e74e496ec32a13a5ae71df71364065f7be3cca 
# |         4:  llvm revision 73e74e496ec32a13a5ae71df71364065f7be3cca 
# |         5: done 
# | next:4     !~~~  error: match on wrong line
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

@DavidSpickett
Copy link
Collaborator

Merging to fix our Windows bot.

@DavidSpickett DavidSpickett merged commit 3dedcab into llvm:main Oct 14, 2024
9 checks passed
@JDevlieghere JDevlieghere deleted the system-log-windows branch October 14, 2024 16:11
DanielCChen pushed a commit to DanielCChen/llvm-project that referenced this pull request Oct 16, 2024
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.
JDevlieghere added a commit to swiftlang/llvm-project that referenced this pull request Apr 10, 2025
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 3dedcab)
JDevlieghere added a commit to swiftlang/llvm-project that referenced this pull request Apr 11, 2025
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 3dedcab)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants