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

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 6 07:33:50 PST 2023


================
@@ -163,6 +175,12 @@ bool SymbolContext::DumpStopContext(Stream *s, ExecutionContextScope *exe_scope,
       dumped_something = true;
       if (symbol->GetType() == eSymbolTypeTrampoline)
         s->PutCString("symbol stub for: ");
+
+      // Similar here, Using re_pattern if the function is called by regex symbol search command
+      if(name){
+        Address::re_pattern(s, symbol->GetName().GetStringRef().str().c_str(), name);
+      }
+      else
       symbol->GetName().Dump(s);
----------------
DavidSpickett wrote:

Here is a place where it would be good to just be able to call .Dump() one way instead of having this if.

If the colouring function was part of lldb utility, that might work. Perhaps in the same area as `lldb_private::ansi::FormatAnsiTerminalCodes`. 

Then all the `Dump` for various things that want colours can be implemented using it.

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


More information about the lldb-commits mailing list