[Lldb-commits] [lldb] [lldb] colorize symbols in image lookup with a regex pattern (PR #69422)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 6 09:00:38 PST 2023


=?utf-8?q?Jos=C3=A9?= L. Junior <josejunior at 10xengineers.ai>,taalhaataahir0102
 <23100293 at lums.edu.pk>,taalhaataahir0102 <23100293 at lums.edu.pk>,taalhaataahir0102
 <23100293 at lums.edu.pk>,taalhaataahir0102 <23100293 at lums.edu.pk>,
=?utf-8?q?Jos=C3=A9?= L. Junior <josejunior at 10xengineers.ai>,
=?utf-8?q?Jos=C3=A9?= L. Junior <josejunior at 10xengineers.ai>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/69422 at github.com>


================
@@ -70,6 +72,32 @@ size_t Stream::PutCString(llvm::StringRef str) {
   return bytes_written;
 }
 
+void Stream::PutCStringColorHighlighted(llvm::StringRef text,
+                                        llvm::StringRef pattern,
+                                        llvm::StringRef prefix,
+                                        llvm::StringRef suffix) {
+  // If there is no pattern to match, we should not use color
+  if (pattern.empty()) {
+    PutCString(text);
+    return;
+  }
----------------
JDevlieghere wrote:

If the prefix and suffix are empty, we can also take this shortcut, right? 

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


More information about the lldb-commits mailing list