================
@@ -403,9 +407,48 @@ bool Address::GetDescription(Stream &s, Target &target,
   return false;
 }
 
+//==================================================================================
+
+// Function to print the searched symbol in red color
+void Address::re_pattern(Stream *strm, const char *text, const char *name) {
----------------
DavidSpickett wrote:

We're moving away from PrintRed, that's good. I suggest you name this something 
like `DumpName` to fit the rest of the class style.

Then below in Address::dump all it has to do is call DumpName (and anyone 
calling Address:dump externally does the same).

One way to make sure this has been done is to make Address::re_pattern / 
Address::DumpName private. Then you'll get a compiler error if someone is 
calling it directly.

Also, the parameters are confusingly named now. What this function does it dump 
the name of the symbol but the name is passed as `text` and then there's the 
regex pattern as `name`. `text` is fine, but I think `name` should be `pattern` 
or `re_pattern`, whatever makes it clear to you that this is a pattern we will 
use to match things, not some plain text to dump.

https://github.com/llvm/llvm-project/pull/69422
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to