summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp30
-rw-r--r--lldb/test/expression_command/test/TestExprs.py1
-rw-r--r--lldb/test/lang/cpp/call-function/TestCallCPPFunction.py1
-rw-r--r--lldb/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py1
4 files changed, 30 insertions, 3 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index dd34a364c73..d0b1a5ac00d 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -3542,8 +3542,38 @@ SymbolFileDWARF::FindFunctions (const ConstString &name,
Index ();
if (name_type_mask & eFunctionNameTypeFull)
+ {
FindFunctions (name, m_function_fullname_index, sc_list);
+ // Temporary workaround for global/anonymous namespace functions on linux
+#if defined (__linux__)
+ // If we didn't find any functions in the global namespace try
+ // looking in the basename index but ignore any returned
+ // functions that have a namespace (ie. mangled names starting with
+ // '_ZN') but keep functions which have an anonymous namespace
+ if (sc_list.GetSize() == 0)
+ {
+ SymbolContextList temp_sc_list;
+ FindFunctions (name, m_function_basename_index, temp_sc_list);
+ if (!namespace_decl)
+ {
+ SymbolContext sc;
+ for (uint32_t i = 0; i < temp_sc_list.GetSize(); i++)
+ {
+ if (temp_sc_list.GetContextAtIndex(i, sc))
+ {
+ ConstString func_name = sc.GetFunctionName(Mangled::ePreferDemangled);
+ if (!strncmp(name.GetCString(), "_ZN", 3) ||
+ strncmp(name.GetCString(), "(anonymous namespace)", 21))
+ {
+ sc_list.Append(sc);
+ }
+ }
+ }
+ }
+ }
+#endif
+ }
DIEArray die_offsets;
DWARFCompileUnit *dwarf_cu = NULL;
diff --git a/lldb/test/expression_command/test/TestExprs.py b/lldb/test/expression_command/test/TestExprs.py
index 2c00d58a02b..422e05e3e2e 100644
--- a/lldb/test/expression_command/test/TestExprs.py
+++ b/lldb/test/expression_command/test/TestExprs.py
@@ -80,7 +80,6 @@ class BasicExprCommandsTestCase(TestBase):
"a.out"])
# (const char *) $8 = 0x... "/Volumes/data/lldb/svn/trunk/test/expression_command/test/a.out"
- @expectedFailureLinux # bugzilla 15854
@python_api_test
def test_evaluate_expression_python(self):
"""Test SBFrame.EvaluateExpression() API for evaluating an expression."""
diff --git a/lldb/test/lang/cpp/call-function/TestCallCPPFunction.py b/lldb/test/lang/cpp/call-function/TestCallCPPFunction.py
index 6abe9854ccf..c573770334d 100644
--- a/lldb/test/lang/cpp/call-function/TestCallCPPFunction.py
+++ b/lldb/test/lang/cpp/call-function/TestCallCPPFunction.py
@@ -17,7 +17,6 @@ class CallCPPFunctionTestCase(TestBase):
self.buildDsym()
self.call_cpp_function()
- @expectedFailureLinux # bugzilla 15854
@dwarf_test
def test_with_dwarf_and_run_command(self):
"""Test calling a function by basename"""
diff --git a/lldb/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py b/lldb/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
index 5b45851b637..634c28c02ed 100644
--- a/lldb/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
+++ b/lldb/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
@@ -17,7 +17,6 @@ class CPPStaticMethodsTestCase(TestBase):
self.buildDsym()
self.static_method_commands()
- @expectedFailureLinux # bugzilla 15854
@dwarf_test
def test_with_dwarf_and_run_command(self):
"""Test that functions with the same name are resolved correctly"""
OpenPOWER on IntegriCloud