diff options
Diffstat (limited to 'lldb/test/python_api/target/TestTargetAPI.py')
-rw-r--r-- | lldb/test/python_api/target/TestTargetAPI.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/lldb/test/python_api/target/TestTargetAPI.py b/lldb/test/python_api/target/TestTargetAPI.py index 6c2c4fd4784..81d250b497f 100644 --- a/lldb/test/python_api/target/TestTargetAPI.py +++ b/lldb/test/python_api/target/TestTargetAPI.py @@ -22,7 +22,12 @@ class TargetAPITestCase(TestBase): self.find_global_variables('a.out') #rdar://problem/9700873 - @unittest2.skip("segmentation fault -- skipping") + # Find global variable value fails for dwarf if inferior not started + # (Was CrashTracer: [USER] 1 crash in Python at _lldb.so: lldb_private::MemoryCache::Read + 94) + # + # It does not segfaults now. But for dwarf, the variable value is None if + # the inferior process does not exist yet. The radar has been updated. + #@unittest232.skip("segmentation fault -- skipping") @python_api_test def test_find_global_variables_with_dwarf(self): """Exercise SBTarget.FindGlobalVariables() API.""" @@ -102,9 +107,24 @@ class TargetAPITestCase(TestBase): target = self.dbg.CreateTarget(exe) self.assertTrue(target, VALID_TARGET) + #rdar://problem/9700873 + # Find global variable value fails for dwarf if inferior not started + # (Was CrashTracer: [USER] 1 crash in Python at _lldb.so: lldb_private::MemoryCache::Read + 94) + # + # Remove the lines to create a breakpoint and to start the inferior + # which are workarounds for the dwarf case. + + breakpoint = target.BreakpointCreateByLocation('main.c', self.line1) + self.assertTrue(breakpoint, VALID_BREAKPOINT) + + # Now launch the process, and do not stop at entry point. + process = target.LaunchSimple(None, None, os.getcwd()) + self.assertTrue(process, PROCESS_IS_VALID) + value_list = target.FindGlobalVariables('my_global_var_of_char_type', 3) self.assertTrue(value_list.GetSize() == 1) my_global_var = value_list.GetValueAtIndex(0) + self.DebugSBValue(my_global_var) self.assertTrue(my_global_var) self.expect(my_global_var.GetName(), exe=False, startstr = "my_global_var_of_char_type") |