[llvm] [Dexter] llvm-lit: Always log DAP messages to stderr (PR #158586)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 15 02:27:37 PDT 2025
https://github.com/OCHyams updated https://github.com/llvm/llvm-project/pull/158586
>From 54900222ff34db244dc3de2c1b1d054d2348dff0 Mon Sep 17 00:00:00 2001
From: Orlando Cazalet-Hyams <orlando.hyams at sony.com>
Date: Mon, 15 Sep 2025 10:09:28 +0100
Subject: [PATCH 1/2] [Dexter] llvm-lit: Always log DAP messages to stderr
This will help diagnose flaky buildbots. The stderr output is only shown by
lit if the test fails.
---
.../debuginfo-tests/dexter/dex/debugger/DAP.py | 9 ++++++++-
.../debuginfo-tests/dexter/dex/debugger/Debuggers.py | 6 +++++-
cross-project-tests/lit.cfg.py | 6 ++++--
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DAP.py b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DAP.py
index 4e64f880487f5..a849990678d42 100644
--- a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DAP.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DAP.py
@@ -59,10 +59,17 @@ def _custom_enter(self):
if self.log_file == "-":
self.out_handle = sys.stdout
return
+ if self.log_file == "-e":
+ self.out_handle = sys.stderr
+ return
self.out_handle = open(self.log_file, "w+", encoding="utf-8")
def _custom_exit(self):
- if self.out_handle is not None and self.log_file != "-":
+ if (
+ self.out_handle is not None
+ and self.log_file != "-"
+ and self.log_file != "-e"
+ ):
self.out_handle.close()
self.open = False
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/Debuggers.py b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/Debuggers.py
index ef23dcf6bebbc..eedd68fcdb1ba 100644
--- a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/Debuggers.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/Debuggers.py
@@ -186,7 +186,11 @@ def handle_debugger_tool_base_options(context, defaults): # noqa
'<d>could not find</> <r>"{}"</>'.format(options.lldb_executable)
)
- if options.dap_message_log is not None and options.dap_message_log != "-":
+ if (
+ options.dap_message_log is not None
+ and options.dap_message_log != "-"
+ and options.dap_message_log != "-e"
+ ):
options.dap_message_log = os.path.abspath(options.dap_message_log)
diff --git a/cross-project-tests/lit.cfg.py b/cross-project-tests/lit.cfg.py
index f042c27aece9f..e702a7739f511 100644
--- a/cross-project-tests/lit.cfg.py
+++ b/cross-project-tests/lit.cfg.py
@@ -121,7 +121,7 @@ def configure_dexter_substitutions():
tools.append(
ToolSubst(
"%dexter_lldb_args",
- f'--lldb-executable "{lldb_dap_path}" --debugger lldb-dap',
+ f'--lldb-executable "{lldb_dap_path}" --debugger lldb-dap --dap-message-log=-e',
)
)
@@ -148,7 +148,9 @@ def configure_dexter_substitutions():
dexter_regression_test_c_builder = "clang"
dexter_regression_test_cxx_builder = "clang++"
dexter_regression_test_debugger = "lldb-dap"
- dexter_regression_test_additional_flags = f'--lldb-executable "{lldb_dap_path}"'
+ dexter_regression_test_additional_flags = (
+ f'--lldb-executable "{lldb_dap_path}" --dap-message-log=-e'
+ )
dexter_regression_test_c_flags = "-O0 -glldb -std=gnu11"
dexter_regression_test_cxx_flags = "-O0 -glldb -std=gnu++11"
>From e68403c7a1c9ce8d01a7811e8bfb70ce3e6dd883 Mon Sep 17 00:00:00 2001
From: Orlando Cazalet-Hyams <orlando.hyams at sony.com>
Date: Mon, 15 Sep 2025 10:27:01 +0100
Subject: [PATCH 2/2] helptext
---
.../debuginfo-tests/dexter/dex/debugger/Debuggers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/Debuggers.py b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/Debuggers.py
index eedd68fcdb1ba..0232bdeb64b57 100644
--- a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/Debuggers.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/Debuggers.py
@@ -74,7 +74,7 @@ def add_debugger_tool_base_arguments(parser, defaults):
type=str,
metavar="<filepath>",
default=None,
- help="log file for messages between Dexter and the debug adapter; set to '-' to log to stdout",
+ help="log file for messages between Dexter and the debug adapter; set to '-' to log to stdout, '-e' to log to stderr",
)
dap_group.add_argument(
"--colorize-dap-log",
More information about the llvm-commits
mailing list