summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/python_api
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-02-15 12:27:16 +0000
committerPavel Labath <labath@google.com>2017-02-15 12:27:16 +0000
commitd875aae9c041f856cbfc7067f29cffd7aaa5a67b (patch)
treeed5dde9a2b452de150492588bd87b3528791effb /lldb/packages/Python/lldbsuite/test/python_api
parent0f0e5bd3c643109c2782a21e2aebe1414d690327 (diff)
downloadbcm5719-llvm-d875aae9c041f856cbfc7067f29cffd7aaa5a67b.tar.gz
bcm5719-llvm-d875aae9c041f856cbfc7067f29cffd7aaa5a67b.zip
Fix TestNameLookup for GCC
Summary: GCC emits also symbols for the __PRETTY_FUNCTION__ virtual variable, which we accidentaly pick up when looking for functions for with "unique_function_name" in the name. This makes the target.FindFunctions call fail, as that symbol is not a function. I also strenghten the test a bit to make sure we actually find all the functions we are interested in. I've put a check that we find at least 6 functions, but maybe this should be *exactly* 6 ? Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D29932 llvm-svn: 295170
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api')
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/name_lookup/TestNameLookup.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/name_lookup/TestNameLookup.py b/lldb/packages/Python/lldbsuite/test/python_api/name_lookup/TestNameLookup.py
index 522af9ff951..b7a683f25f6 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/name_lookup/TestNameLookup.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/name_lookup/TestNameLookup.py
@@ -20,7 +20,6 @@ class TestNameLookup(TestBase):
mydir = TestBase.compute_mydir(__file__)
@add_test_categories(['pyapi'])
- @expectedFailureAll(compiler="gcc")
def test_target(self):
"""Exercise SBTarget.FindFunctions() with various name masks.
@@ -44,7 +43,7 @@ class TestNameLookup(TestBase):
for i in range(num_symbols):
symbol = exe_module.GetSymbolAtIndex(i);
name = symbol.GetName()
- if name and 'unique_function_name' in name:
+ if name and 'unique_function_name' in name and '__PRETTY_FUNCTION__' not in name:
mangled = symbol.GetMangledName()
if mangled:
mangled_to_symbol[mangled] = symbol
@@ -56,6 +55,7 @@ class TestNameLookup(TestBase):
# Make sure each mangled name turns up exactly one match when looking up
# functions by full name and using the mangled name as the name in the
# lookup
+ self.assertGreaterEqual(len(mangled_to_symbol), 6)
for mangled in mangled_to_symbol.keys():
symbol_contexts = target.FindFunctions(mangled, lldb.eFunctionNameTypeFull)
self.assertTrue(symbol_contexts.GetSize() == 1)
OpenPOWER on IntegriCloud