Fix the lldb_private::Function::GetDescription to print out the name and mangled name correctly. Previously this was getting the function type's name which was not correct.

This info appears in the output of "image lookup --verbose --address ADDRESS".

llvm-svn: 294804
This commit is contained in:
Greg Clayton 2017-02-10 23:32:06 +00:00
parent 541cf97fe0
commit b663010f4d
1 changed files with 8 additions and 5 deletions

View File

@ -228,12 +228,15 @@ const CompileUnit *Function::GetCompileUnit() const { return m_comp_unit; }
void Function::GetDescription(Stream *s, lldb::DescriptionLevel level,
Target *target) {
Type *func_type = GetType();
const char *name = func_type ? func_type->GetName().AsCString() : "<unknown>";
*s << "id = " << (const UserID &)*this << ", name = \"" << name
<< "\", range = ";
ConstString name = GetName();
ConstString mangled = m_mangled.GetMangledName();
*s << "id = " << (const UserID &)*this;
if (name)
*s << ", name = \"" << name.GetCString() << '"';
if (mangled)
*s << ", mangled = \"" << mangled.GetCString() << '"';
*s << ", range = ";
Address::DumpStyle fallback_style;
if (level == eDescriptionLevelVerbose)
fallback_style = Address::DumpStyleModuleWithFileAddress;