[Lldb-commits] [lldb] Colorize output when searching for symbols in lldb (PR #69422)

José Lira Junior via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 14 08:19:20 PST 2023


================
@@ -252,11 +253,16 @@ void Symbol::GetDescription(Stream *s, lldb::DescriptionLevel level,
       s->Printf(", value = 0x%16.16" PRIx64,
                 m_addr_range.GetBaseAddress().GetOffset());
   }
-  ConstString demangled = GetMangled().GetDemangledName();
-  if (demangled)
-    s->Printf(", name=\"%s\"", demangled.AsCString());
-  if (m_mangled.GetMangledName())
-    s->Printf(", mangled=\"%s\"", m_mangled.GetMangledName().AsCString());
+  if (ConstString mangled_name = m_mangled.GetMangledName()) {
+    s->Printf(", mangled=\"");
+    Address::DumpName(s, mangled_name.GetStringRef(), pattern);
+    s->Printf("\"");
+  }
+  if (ConstString demangled = m_mangled.GetDemangledName()) {
+    s->Printf(", name=\"");
+    Address::DumpName(s, demangled.GetStringRef(), pattern);
+    s->Printf("\"");
----------------
junior-jl wrote:

Thanks, corrected!

https://github.com/llvm/llvm-project/pull/69422


More information about the lldb-commits mailing list