[Lldb-commits] [lldb] r116939 - in /lldb/trunk/test: breakpoint_conditions/TestBreakpointConditions.py breakpoint_conditions/main.c lldbtest.py

Johnny Chen johnny.chen at apple.com
Wed Oct 20 11:38:48 PDT 2010


Author: johnny
Date: Wed Oct 20 13:38:48 2010
New Revision: 116939

URL: http://llvm.org/viewvc/llvm-project?rev=116939&view=rev
Log:
Make the breakpoint condition test more robust with regard to checking the correct
parent call frame information.  And comment out the check for stop reason for the
time being.  The stop reason disappeared from the "thread backtrace" output for
breakpoint stop with condition.

Modified:
    lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py
    lldb/trunk/test/breakpoint_conditions/main.c
    lldb/trunk/test/lldbtest.py

Modified: lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py?rev=116939&r1=116938&r2=116939&view=diff
==============================================================================
--- lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py (original)
+++ lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py Wed Oct 20 13:38:48 2010
@@ -27,7 +27,8 @@
         # Call super's setUp().
         TestBase.setUp(self)
         # Find the line number to of function 'c'.
-        self.line = line_number('main.c', '// Find the line number of function "c" here.')
+        self.line1 = line_number('main.c', '// Find the line number of function "c" here.')
+        self.line2 = line_number('main.c', "// Find the line number of c's parent call here.")
 
     def breakpoint_conditions(self):
         """Exercise breakpoint condition with 'breakpoint modify -c <expr> id'."""
@@ -55,10 +56,11 @@
                        "hit count = 3"])
 
         # The frame #0 should correspond to main.c:36, the executable statement
-        # in function name 'c'.
-        self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ["stop reason = breakpoint"],
-            patterns = ["frame #0.*main.c:%d" % self.line])
+        # in function name 'c'.  And the parent frame should point to main.c:24.
+        self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT_CONDITION,
+            #substrs = ["stop reason = breakpoint"],
+            patterns = ["frame #0.*main.c:%d" % self.line1,
+                        "frame #1.*main.c:%d" % self.line2])
 
 
 if __name__ == '__main__':

Modified: lldb/trunk/test/breakpoint_conditions/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/breakpoint_conditions/main.c?rev=116939&r1=116938&r2=116939&view=diff
==============================================================================
--- lldb/trunk/test/breakpoint_conditions/main.c (original)
+++ lldb/trunk/test/breakpoint_conditions/main.c Wed Oct 20 13:38:48 2010
@@ -21,7 +21,7 @@
     if (val <= 1)
         return b(val);
     else if (val >= 3)
-        return c(val);
+        return c(val); // Find the line number of c's parent call here.
 
     return val;
 }

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=116939&r1=116938&r2=116939&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Wed Oct 20 13:38:48 2010
@@ -153,6 +153,8 @@
 
 STOPPED_DUE_TO_BREAKPOINT = "Process state is stopped due to breakpoint"
 
+STOPPED_DUE_TO_BREAKPOINT_CONDITION = "Stopped due to breakpoint condition"
+
 STOPPED_DUE_TO_SIGNAL = "Process state is stopped due to signal"
 
 STOPPED_DUE_TO_STEP_IN = "Process state is stopped due to step in"





More information about the lldb-commits mailing list