[Lldb-commits] [lldb] [lldb-dap] Ensure the IO forwarding threads are managed by the DAP object lifecycle. (PR #122783)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Tue Jan 14 06:34:11 PST 2025
================
@@ -10,22 +10,46 @@
class DAPTestCaseBase(TestBase):
# set timeout based on whether ASAN was enabled or not. Increase
# timeout by a factor of 10 if ASAN is enabled.
- timeoutval = 10 * (10 if ('ASAN_OPTIONS' in os.environ) else 1)
+ timeoutval = 10 * (10 if ("ASAN_OPTIONS" in os.environ) else 1)
+ lldbLogChannels = ["default"]
NO_DEBUG_INFO_TESTCASE = True
def create_debug_adaptor(self, lldbDAPEnv=None):
"""Create the Visual Studio Code debug adaptor"""
self.assertTrue(
is_exe(self.lldbDAPExec), "lldb-dap must exist and be executable"
)
- log_file_path = self.getBuildArtifact("dap.txt")
+
+ # DAP communication logs.
+ dap_log = self.getBuildArtifact("dap.txt")
+ # Enable lldb logs to aid in debugging failures.
+ lldb_log = self.getBuildArtifact("lldb.log")
+
+ init_commands = self.setUpCommands()
+ init_commands.append(
+ "log enable -Tpn -f {} lldb {}".format(
+ lldb_log, " ".join(self.lldbLogChannels)
+ )
+ )
----------------
labath wrote:
I don't think we'd want to enable this everywhere. lldb-dap tests are already a lot more verbose than other lldb tests (which use `self.TraceOn()` to guard noisy parts of the code), and we already have machinery (the `--channel` dotest flag) to enable logging (though it may not work with lldb-dap, and it's not wired up to print them in a way that's visible in the buildbot UI).
https://github.com/llvm/llvm-project/pull/122783
More information about the lldb-commits
mailing list