diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 |
| commit | f3fbd1c0586ff6ec7895991e6c28f61a503c36a8 (patch) | |
| tree | 48d008fd3df8c0e73271a4b18474e0aac6dbfe33 /packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py | |
| parent | 2fc5d2d1dfaf623ce4e24cd8590565902f8c557c (diff) | |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py')
| -rw-r--r-- | packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py b/packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py new file mode 100644 index 000000000000..1d8d70114573 --- /dev/null +++ b/packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py @@ -0,0 +1,36 @@ +""" +Test SBSymbolContext APIs. +""" + +from __future__ import print_function + +import os + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class SymbolContextTwoFilesTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @add_test_categories(['pyapi']) + @expectedFailureAll(oslist=["windows"]) + def test_lookup_by_address(self): + """Test lookup by address in a module with multiple compilation units""" + self.build() + exe = os.path.join(os.getcwd(), "a.out") + + target = self.dbg.CreateTarget(exe) + self.assertTrue(target, VALID_TARGET) + + module = target.GetModuleAtIndex(0) + self.assertTrue(module.IsValid()) + for symbol_name in ["struct1::f()", "struct2::f()"]: + sc_list = module.FindFunctions(symbol_name, lldb.eSymbolTypeCode) + self.assertTrue(1, sc_list.GetSize()) + symbol_address = sc_list.GetContextAtIndex(0).GetSymbol().GetStartAddress() + self.assertTrue(symbol_address.IsValid()) + sc_by_address = module.ResolveSymbolContextForAddress(symbol_address, lldb.eSymbolContextFunction) + self.assertEqual(symbol_name, sc_by_address.GetFunction().GetName()) |
