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

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 14 01:34:18 PST 2023


================
@@ -403,9 +404,41 @@ bool Address::GetDescription(Stream &s, Target &target,
   return false;
 }
 
+void Address::DumpName(Stream *strm, llvm::StringRef text,
+                       const char *pattern) {
+  if (!pattern) {
+    strm->PutCString(text.data());
+    return;
+  }
+
+  llvm::Regex reg_pattern(pattern);
+  llvm::SmallVector<llvm::StringRef, 1> matches;
+  llvm::StringRef remaining = text;
+  std::string red_start =
----------------
DavidSpickett wrote:

Worth adding a comment here that if pattern is not null, we know we have been asked to use colours.

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


More information about the lldb-commits mailing list