[Lldb-commits] [lldb] r237931 - Re-enable packet logging for GdbRemote/LldbServer tests

Vince Harron vince at nethacker.com
Thu May 21 11:51:20 PDT 2015


Author: vharron
Date: Thu May 21 13:51:20 2015
New Revision: 237931

URL: http://llvm.org/viewvc/llvm-project?rev=237931&view=rev
Log:
Re-enable packet logging for GdbRemote/LldbServer tests

Creates logs in session dir

Differential Revision: http://reviews.llvm.org/D9847


Modified:
    lldb/trunk/test/lldbtest.py
    lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=237931&r1=237930&r2=237931&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Thu May 21 13:51:20 2015
@@ -1145,11 +1145,11 @@ class Base(unittest2.TestCase):
 
         # 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 @@ class Base(unittest2.TestCase):
         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

Modified: lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py?rev=237931&r1=237930&r2=237931&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py (original)
+++ lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py Thu May 21 13:51:20 2015
@@ -168,6 +168,11 @@ class GdbRemoteTestCaseBase(TestBase):
                 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 @@ class GdbRemoteTestCaseBase(TestBase):
         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





More information about the lldb-commits mailing list