summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/value/change_values
diff options
context:
space:
mode:
authorMatt Kopec <Matt.Kopec@intel.com>2013-03-15 22:49:52 +0000
committerMatt Kopec <Matt.Kopec@intel.com>2013-03-15 22:49:52 +0000
commit862884327f424cafd518f21cbeff44fdf9cccd84 (patch)
treefd0c8ace2ed0e597b80da736843c97c066eba302 /lldb/test/python_api/value/change_values
parent0aef0f032f8acb58fe97452dce8be5cbec2feab8 (diff)
downloadbcm5719-llvm-862884327f424cafd518f21cbeff44fdf9cccd84.tar.gz
bcm5719-llvm-862884327f424cafd518f21cbeff44fdf9cccd84.zip
Rework TestChangedValueAPI.py to account for gcc setting multiple breakpoints.
llvm-svn: 177198
Diffstat (limited to 'lldb/test/python_api/value/change_values')
-rw-r--r--lldb/test/python_api/value/change_values/TestChangeValueAPI.py18
-rw-r--r--lldb/test/python_api/value/change_values/main.c1
2 files changed, 16 insertions, 3 deletions
diff --git a/lldb/test/python_api/value/change_values/TestChangeValueAPI.py b/lldb/test/python_api/value/change_values/TestChangeValueAPI.py
index fb5c294fe76..b84b3dc29e1 100644
--- a/lldb/test/python_api/value/change_values/TestChangeValueAPI.py
+++ b/lldb/test/python_api/value/change_values/TestChangeValueAPI.py
@@ -38,9 +38,9 @@ class ChangeValueAPITestCase(TestBase):
self.exe_name = self.testMethodName
# Find the line number to of function 'c'.
self.line = line_number('main.c', '// Stop here and set values')
+ self.check_line = line_number('main.c', '// Stop here and check values')
self.end_line = line_number ('main.c', '// Set a breakpoint here at the end')
- @expectedFailureGcc # PR-15039: If GCC is the test compiler, stdout is not available via lldb.SBProcess.GetSTDOUT()
def change_value_api(self, exe_name):
"""Exercise some SBValue APIs."""
exe = os.path.join(os.getcwd(), exe_name)
@@ -53,6 +53,10 @@ class ChangeValueAPITestCase(TestBase):
breakpoint = target.BreakpointCreateByLocation('main.c', self.line)
self.assertTrue(breakpoint, VALID_BREAKPOINT)
+ # Create the breakpoint inside the function 'main'
+ check_breakpoint = target.BreakpointCreateByLocation('main.c', self.check_line)
+ self.assertTrue(check_breakpoint, VALID_BREAKPOINT)
+
# Create the breakpoint inside function 'main'.
end_breakpoint = target.BreakpointCreateByLocation('main.c', self.end_line)
self.assertTrue(end_breakpoint, VALID_BREAKPOINT)
@@ -116,8 +120,16 @@ class ChangeValueAPITestCase(TestBase):
self.assertTrue (error.Success(), "Got a changed value from ptr->second_val")
self.assertTrue (actual_value == 98765, "Got the right changed value from ptr->second_val")
- # Now step, grab the stdout and make sure we changed the real values as well...
- thread.StepOver()
+ # gcc may set multiple locations for breakpoint
+ breakpoint.SetEnabled(False)
+
+ # Now continue, grab the stdout and make sure we changed the real values as well...
+ process.Continue();
+
+ self.assertTrue(process.GetState() == lldb.eStateStopped)
+ thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
+ self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+
expected_value = "Val - 12345 Mine - 55, 98765, 55555555. Ptr - 66, 98765, 66666666"
stdout = process.GetSTDOUT(1000)
self.assertTrue (expected_value in stdout, "STDOUT showed changed values.")
diff --git a/lldb/test/python_api/value/change_values/main.c b/lldb/test/python_api/value/change_values/main.c
index a9cff8ec231..54443478df2 100644
--- a/lldb/test/python_api/value/change_values/main.c
+++ b/lldb/test/python_api/value/change_values/main.c
@@ -24,6 +24,7 @@ int main ()
mine.first_val, mine.second_val, mine.third_val,
ptr->first_val, ptr->second_val, ptr->third_val);
+ // Stop here and check values
printf ("This is just another call which we won't make it over %d.", val);
return 0; // Set a breakpoint here at the end
}
OpenPOWER on IntegriCloud