diff options
author | Greg Clayton <gclayton@apple.com> | 2012-07-18 20:47:40 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-07-18 20:47:40 +0000 |
commit | 5e0c5e8108e8886e4aa7ea489d0af5bc4f521a25 (patch) | |
tree | af1c4f907890dd48eb2be3a7739737f8ddf459cc /lldb/source/Expression/IRForTarget.cpp | |
parent | 6b76bc76fa77e526bff989c9007b7aeae0e95a23 (diff) | |
download | bcm5719-llvm-5e0c5e8108e8886e4aa7ea489d0af5bc4f521a25.tar.gz bcm5719-llvm-5e0c5e8108e8886e4aa7ea489d0af5bc4f521a25.zip |
<rdar://problem/10998370>
Improved the error message when we can find a function in the current program by printing the demangled name.
Also added the ability to create lldb_private::Mangled instances with a ConstString when we already have a ConstString for a mangled or demangled name. Also added the ability to call SetValue with a ConstString and also without a boolean to indicate if the string is mangled where we will now auto-detect if the string is mangled.
llvm-svn: 160450
Diffstat (limited to 'lldb/source/Expression/IRForTarget.cpp')
-rw-r--r-- | lldb/source/Expression/IRForTarget.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp index 534445dbf49..e5a93fc8fb7 100644 --- a/lldb/source/Expression/IRForTarget.cpp +++ b/lldb/source/Expression/IRForTarget.cpp @@ -229,7 +229,7 @@ IRForTarget::GetFunctionAddress (llvm::Function *fun, { if (!m_decl_map->GetFunctionInfo (fun_decl, fun_addr)) { - lldb_private::ConstString alternate_mangling_const_str; + lldb_private::ConstString altnernate_name; bool found_it = m_decl_map->GetFunctionAddress (name, fun_addr); if (!found_it) { @@ -240,27 +240,35 @@ IRForTarget::GetFunctionAddress (llvm::Function *fun, { std::string alternate_mangling("_ZNKSs"); alternate_mangling.append (name_cstr + strlen("_ZNKSbIcE")); - alternate_mangling_const_str.SetCString(alternate_mangling.c_str()); - found_it = m_decl_map->GetFunctionAddress (alternate_mangling_const_str, fun_addr); + altnernate_name.SetCString(alternate_mangling.c_str()); + found_it = m_decl_map->GetFunctionAddress (altnernate_name, fun_addr); } } if (!found_it) { + lldb_private::Mangled mangled_name(name); + lldb_private::Mangled alt_mangled_name(altnernate_name); if (log) { - if (alternate_mangling_const_str) - log->Printf("Function \"%s\" (alternate name \"%s\") has no address", name.GetCString(), alternate_mangling_const_str.GetCString()); + if (alt_mangled_name) + log->Printf("Function \"%s\" (alternate name \"%s\") has no address", + mangled_name.GetName().GetCString(), + alt_mangled_name.GetName().GetCString()); else - log->Printf("Function \"%s\" had no address", name.GetCString()); + log->Printf("Function \"%s\" had no address", + mangled_name.GetName().GetCString()); } if (m_error_stream) { - if (alternate_mangling_const_str) - m_error_stream->Printf("error: call to a function '%s' (alternate name '%s') that is not present in the target\n", name.GetCString(), alternate_mangling_const_str.GetCString()); + if (alt_mangled_name) + m_error_stream->Printf("error: call to a function '%s' (alternate name '%s') that is not present in the target\n", + mangled_name.GetName().GetCString(), + alt_mangled_name.GetName().GetCString()); else - m_error_stream->Printf("error: call to a function '%s' that is not present in the target\n", name.GetCString()); + m_error_stream->Printf("error: call to a function '%s' that is not present in the target\n", + mangled_name.GetName().GetCString()); } return false; } |