diff options
author | Sean Callanan <scallanan@apple.com> | 2011-10-25 18:02:05 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2011-10-25 18:02:05 +0000 |
commit | f463856fd0e5b4ace836afed0801ae3edcd4b883 (patch) | |
tree | a3f442a0796cc4d2c26167ab40fd278c4772258d | |
parent | 3d0fcf5eaebf7518caab09c51957d02c3ffa3ed4 (diff) | |
download | bcm5719-llvm-f463856fd0e5b4ace836afed0801ae3edcd4b883.tar.gz bcm5719-llvm-f463856fd0e5b4ace836afed0801ae3edcd4b883.zip |
Fixed our handling of const functions, compensating
for debug information that occasionally gets the
const-ness of member functions wrong. We used to
demangle the name, add "const," and remangle it; now
we handle the mangled name directly, which is more
robust.
llvm-svn: 142933
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index bc10eccd26c..fb8cc591297 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -674,22 +674,17 @@ ClangExpressionDeclMap::GetFunctionAddress // We occasionally get debug information in which a const function is reported // as non-const, so the mangled name is wrong. This is a hack to compensate. - Mangled mangled(name.GetCString(), true); - - ConstString demangled_name = mangled.GetDemangledName(); - - if (strlen(demangled_name.GetCString())) + if (!strncmp(name.GetCString(), "_ZN", 3) && + strncmp(name.GetCString(), "_ZNK", 4)) { - std::string const_name_scratch(demangled_name.GetCString()); - - const_name_scratch.append(" const"); - - ConstString const_name(const_name_scratch.c_str()); - - FindCodeSymbolInContext(name, m_parser_vars->m_sym_ctx, sc_list); + std::string fixed_scratch("_ZNK"); + fixed_scratch.append(name.GetCString() + 3); + ConstString fixed_name(fixed_scratch.c_str()); if (log) - log->Printf("Found %d results with const name %s", sc_list.GetSize(), const_name.GetCString()); + 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); } } |