diff options
| author | Siva Chandra <sivachandra@google.com> | 2015-09-03 23:27:10 +0000 |
|---|---|---|
| committer | Siva Chandra <sivachandra@google.com> | 2015-09-03 23:27:10 +0000 |
| commit | 0f4873d7d0417c9f0ff35b911047aa7852dc9742 (patch) | |
| tree | 92db434bc9019086334b5c77b6744f32d60db459 /lldb/source/Expression/ClangExpressionDeclMap.cpp | |
| parent | 75afa2b6b61e26ccc560732d33dcad3c1fc9f871 (diff) | |
| download | bcm5719-llvm-0f4873d7d0417c9f0ff35b911047aa7852dc9742.tar.gz bcm5719-llvm-0f4873d7d0417c9f0ff35b911047aa7852dc9742.zip | |
Lookup function using full name if one with mangled name is not found.
Summary:
Remove expected failure decorators from tests which now should start
passing.
Reviewers: clayborg, spyffe
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12613
llvm-svn: 246820
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
| -rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index e6963eff414..4e12c6642c8 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -47,6 +47,8 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h" + using namespace lldb; using namespace lldb_private; using namespace clang; @@ -498,6 +500,7 @@ FindCodeSymbolInContext ( const ConstString &name, SymbolContext &sym_ctx, + uint32_t name_type_mask, SymbolContextList &sc_list ) { @@ -506,7 +509,7 @@ FindCodeSymbolInContext if (sym_ctx.module_sp) sym_ctx.module_sp->FindFunctions(name, NULL, - eFunctionNameTypeAuto, + name_type_mask, true, // include_symbols false, // include_inlines true, // append @@ -515,7 +518,7 @@ FindCodeSymbolInContext { if (sym_ctx.target_sp) sym_ctx.target_sp->GetImages().FindFunctions(name, - eFunctionNameTypeAuto, + name_type_mask, true, // include_symbols false, // include_inlines true, // append @@ -573,10 +576,33 @@ ClangExpressionDeclMap::GetFunctionAddress SymbolContextList sc_list; - FindCodeSymbolInContext(name, m_parser_vars->m_sym_ctx, sc_list); + FindCodeSymbolInContext(name, m_parser_vars->m_sym_ctx, eFunctionNameTypeAuto, sc_list); uint32_t sc_list_size = sc_list.GetSize(); - + + if (sc_list_size == 0) + { + SymbolContext &sc = m_parser_vars->m_sym_ctx; + if (sc.comp_unit) + { + LanguageType lang_type = sc.comp_unit->GetLanguage(); + if (Language::LanguageIsCPlusPlus(lang_type) && + CPlusPlusLanguage::IsCPPMangledName(name.AsCString())) + { + // 1. Demangle the name + Mangled mangled(name, true); + ConstString demangled = mangled.GetDemangledName(lang_type); + + if (demangled) + { + FindCodeSymbolInContext( + demangled, m_parser_vars->m_sym_ctx, eFunctionNameTypeFull, sc_list); + sc_list_size = sc_list.GetSize(); + } + } + } + } + if (sc_list_size == 0) { // We occasionally get debug information in which a const function is reported @@ -592,7 +618,8 @@ ClangExpressionDeclMap::GetFunctionAddress if (log) log->Printf("Failed to find symbols given non-const name %s; trying %s", name.GetCString(), fixed_name.GetCString()); - FindCodeSymbolInContext(fixed_name, m_parser_vars->m_sym_ctx, sc_list); + FindCodeSymbolInContext( + fixed_name, m_parser_vars->m_sym_ctx, eFunctionNameTypeAuto, sc_list); sc_list_size = sc_list.GetSize(); } } |

