[Lldb-commits] [lldb] r294804 - 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.

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 10 15:32:06 PST 2017


Author: gclayton
Date: Fri Feb 10 17:32:06 2017
New Revision: 294804

URL: http://llvm.org/viewvc/llvm-project?rev=294804&view=rev
Log:
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".


Modified:
    lldb/trunk/source/Symbol/Function.cpp

Modified: lldb/trunk/source/Symbol/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=294804&r1=294803&r2=294804&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Fri Feb 10 17:32:06 2017
@@ -228,12 +228,15 @@ const CompileUnit *Function::GetCompileU
 
 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;




More information about the lldb-commits mailing list