Index: lldb/trunk/test/lldbtest.py =================================================================== --- lldb/trunk/test/lldbtest.py +++ lldb/trunk/test/lldbtest.py @@ -1145,11 +1145,11 @@ # Create a string buffer to record the session info, to be dumped into a # test case specific file if test failure is encountered. - log_basename = self.getLogBasenameForCurrentTest() + self.log_basename = self.getLogBasenameForCurrentTest() - session_file = "{}.log".format(log_basename) + session_file = "{}.log".format(self.log_basename) unbuffered = 0 # 0 is the constant for unbuffered - self.session = open(log_basename, "w", unbuffered) + self.session = open(session_file, "w", unbuffered) # Optimistically set __errored__, __failed__, __expected__ to False # initially. If the test errored/failed, the session info @@ -1532,14 +1532,13 @@ del self.session # process the log files - src_log_basename = self.getLogBasenameForCurrentTest() - log_files_for_this_test = glob.glob(src_log_basename + "*") + log_files_for_this_test = glob.glob(self.log_basename + "*") if prefix != 'Success' or lldbtest_config.log_success: # keep all log files, rename them to include prefix dst_log_basename = self.getLogBasenameForCurrentTest(prefix) for src in log_files_for_this_test: - dst = src.replace(src_log_basename, dst_log_basename) + dst = src.replace(self.log_basename, dst_log_basename) os.rename(src, dst) else: # success! (and we don't want log files) delete log files Index: lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py =================================================================== --- lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py +++ lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py @@ -168,6 +168,11 @@ self.skipTest("lldb-server exe not found") self.debug_monitor_extra_args = ["gdbserver"] + + if len(lldbtest_config.channels) > 0: + self.debug_monitor_extra_args.append("--log-file={}-server.log".format(self.log_basename)) + self.debug_monitor_extra_args.append("--log-channels={}".format(":".join(lldbtest_config.channels))) + if use_named_pipe: (self.named_pipe_path, self.named_pipe, self.named_pipe_fd) = self.create_named_pipe() @@ -175,7 +180,7 @@ self.debug_monitor_exe = get_debugserver_exe() if not self.debug_monitor_exe: self.skipTest("debugserver exe not found") - self.debug_monitor_extra_args = ["--log-file=/tmp/packets-{}.log".format(self._testMethodName), "--log-flags=0x800000"] + self.debug_monitor_extra_args = ["--log-file={}-server.log".format(self.log_basename), "--log-flags=0x800000"] if use_named_pipe: (self.named_pipe_path, self.named_pipe, self.named_pipe_fd) = self.create_named_pipe() # The debugserver stub has a race on handling the 'k' command, so it sends an X09 right away, then sends the real X notification