From c9ea0f84258a4b6e112a04da18cd9c2fc9f697a2 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Mon, 29 Nov 2010 20:49:09 +0000 Subject: [PATCH] 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. llvm-svn: 120318 --- lldb/test/breakpoint_conditions/TestBreakpointConditions.py | 4 ++++ lldb/test/lldbtest.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/lldb/test/breakpoint_conditions/TestBreakpointConditions.py b/lldb/test/breakpoint_conditions/TestBreakpointConditions.py index e1c9dcac9d63..757e0edae12d 100644 --- a/lldb/test/breakpoint_conditions/TestBreakpointConditions.py +++ b/lldb/test/breakpoint_conditions/TestBreakpointConditions.py @@ -56,6 +56,10 @@ class BreakpointConditionsTestCase(TestBase): # 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') diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py index ab87d48396ec..639e348deb4b 100644 --- a/lldb/test/lldbtest.py +++ b/lldb/test/lldbtest.py @@ -151,6 +151,8 @@ BREAKPOINT_HIT_THRICE = "Breakpoint resolved with hit cout = 3" 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" % (