aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
diff options
context:
space:
mode:
authorSiva Chandra <sivachandra@google.com>2016-01-07 23:32:34 +0000
committerSiva Chandra <sivachandra@google.com>2016-01-07 23:32:34 +0000
commit9293fc4185bc737303f0114936ca9a7f467a7bcc (patch)
tree560f4169d2ce25809c88de274648421ee90282fe /lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
parentf94c149f7fc52e48a83a59282fbc63834d464ef0 (diff)
downloadllvm-9293fc4185bc737303f0114936ca9a7f467a7bcc.zip
llvm-9293fc4185bc737303f0114936ca9a7f467a7bcc.tar.gz
llvm-9293fc4185bc737303f0114936ca9a7f467a7bcc.tar.bz2
Better scheme to lookup alternate mangled name when looking up function address.
Summary: This change is relevant for inferiors compiled with GCC. GCC does not emit complete debug info for std::basic_string<...>, and consequently, Clang (the LLDB compiler) does not generate correct mangled names for certain functions. This change removes the hard-coded alternate names in ItaniumABILanguageRuntime.cpp. Before the hard-coded names were put in ItaniumABILanguageRuntime.cpp, one could not evaluate std::string methods (ex. std::string::length). After putting in the hard-coded names, one could evaluate them. However, it did not still enable one to call methods on, say for example, std::vector<string>. This change makes that possible. There is some amount of incompleteness in this change. Consider the following example: std::string hello("hello"), world("world"); std::map<std::string, std::string> m; m[hello] = world; One can still not evaluate the expression "m[hello]" in LLDB. Will address this issue in another pass. Reviewers: jingham, vharron, evgeny777, spyffe, dawn Subscribers: clayborg, dawn, lldb-commits Differential Revision: http://reviews.llvm.org/D12809 llvm-svn: 257113
Diffstat (limited to 'lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp')
-rw-r--r--lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
index a554aa5..09031e2 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -296,6 +296,22 @@ CPlusPlusLanguage::MethodName::GetQualifiers ()
return m_qualifiers;
}
+std::string
+CPlusPlusLanguage::MethodName::GetScopeQualifiedName ()
+{
+ if (!m_parsed)
+ Parse();
+ if (m_basename.empty() || m_context.empty())
+ return std::string();
+
+ std::string res;
+ res += m_context;
+ res += "::";
+ res += m_basename;
+
+ return res;
+}
+
bool
CPlusPlusLanguage::IsCPPMangledName (const char *name)
{