[Lldb-commits] [lldb] r257160 - Fix TestBatchMode on linux

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 8 02:38:22 PST 2016


Author: labath
Date: Fri Jan  8 04:38:20 2016
New Revision: 257160

URL: http://llvm.org/viewvc/llvm-project?rev=257160&view=rev
Log:
Fix TestBatchMode on linux

New test introduced in r257120 was failing on linux. The reason for that the regex for setting
the breakpoint was being applied to the "default file", which in this case was the asm file
containing the definition of the sleep() syscall (because after attach, we are stopped in the
sleep function). I have changed this use the more customary way of setting the breakpoint and
specifying the source file name explicitly.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py?rev=257160&r1=257159&r2=257160&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py Fri Jan  8 04:38:20 2016
@@ -19,6 +19,7 @@ class DriverBatchModeTest (TestBase):
         TestBase.setUp(self)
         # Our simple source filename.
         self.source = 'main.c'
+        self.line = line_number(self.source, 'Stop here to unset keep_waiting')
         self.victim = None
 
     def expect_string (self, string):
@@ -141,7 +142,7 @@ class DriverBatchModeTest (TestBase):
         
         self.victim.expect("Waiting")
 
-        run_commands = ' -b -o "process attach -p %d" -o "breakpoint set -p \'Stop here to unset keep_waiting\' -N keep_waiting" -o "continue" -o "break delete keep_waiting" -o "expr keep_waiting = 0" -o "continue" ' % (victim_pid) 
+        run_commands = ' -b -o "process attach -p %d" -o "breakpoint set --file %s --line %d -N keep_waiting" -o "continue" -o "break delete keep_waiting" -o "expr keep_waiting = 0" -o "continue" ' % (victim_pid, self.source, self.line)
         self.child = pexpect.spawn('%s %s %s %s' % (lldbtest_config.lldbExec, self.lldbOption, run_commands, exe))
 
         child = self.child




More information about the lldb-commits mailing list