diff options
| -rw-r--r-- | lldb/test/python_api/value/change_values/TestChangeValueAPI.py | 18 | ||||
| -rw-r--r-- | lldb/test/python_api/value/change_values/main.c | 1 |
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 } |

