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

Johnny Chen johnny.chen at apple.com
Mon Nov 29 12:49:09 PST 2010


Author: johnny
Date: Mon Nov 29 14:49:09 2010
New Revision: 120318

URL: http://llvm.org/viewvc/llvm-project?rev=120318&view=rev
Log:
Add an expect() statement within breakpoint_conditions() method which tests that
the process status is indeed 'stopped' before invoking 'frame variable -t val'
command to inspect the frame variable.  When I run the test suite, it sometimes
emits an output like:

runCmd: frame variable -t val
runCmd failed!
error: you must be stopped in a valid stack frame to view frame variables.

The expect() statement inserted is to make sure that the process is stopped and
we have a valid frame.

Modified:
    lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py
    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=120318&r1=120317&r2=120318&view=diff
==============================================================================
--- lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py (original)
+++ lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py Mon Nov 29 14:49:09 2010
@@ -56,6 +56,10 @@
         # Now run the program.
         self.runCmd("run", RUN_SUCCEEDED)
 
+        # The process should be stopped.
+        self.expect("process status", PROCESS_STOPPED,
+            patterns = ['Process .* stopped'])
+
         # 'frame variable -t val' should return 3 due to breakpoint condition.
         self.expect("frame variable -t val", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = '(int) val = 3')

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=120318&r1=120317&r2=120318&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Mon Nov 29 14:49:09 2010
@@ -151,6 +151,8 @@
 
 STEP_OUT_SUCCEEDED = "Thread step-out succeeded"
 
+PROCESS_STOPPED = "Process status should be stopped"
+
 STOPPED_DUE_TO_BREAKPOINT = "Process should be stopped due to breakpoint"
 
 STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS = "%s, %s" % (





More information about the lldb-commits mailing list