[Lldb-commits] [lldb] Colorize output when searching for symbols in lldb (PR #69422)
via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 26 02:34:47 PDT 2023
taalhaataahir0102 wrote:
Hi David, I thought writing a few simple and very basic test cases will be better before updating the `printRed` function so that while updating the `printRed` function it easier and quicker for us to test :)
We've written 2 test cases for colorized output search in `tests/Shell/Commands/TestImageLookupColor` by taking help from the following 2 already written test cases:
- https://github.com/llvm/llvm-project/blob/main/lldb/test/Shell/Driver/TestUseColor.test
- https://github.com/llvm/llvm-project/blob/main/lldb/test/Shell/Commands/command-target-modules-lookup.test
First test is a basic regex symbol search for "ma"
The second test (which is failing right now as we have not added the support of | in `printRed` function) searches for 2 symbols using or (|). I'll update the `printRed` function to first split the input string i.e., `name` on | and then apply colors to each of the string in the searched result
Also, we've incorporated the previous feedback.
Next we'll update the `printRed` function:
- Will add or (|) feature in printRed.
- Will update printRed so that we don't have to write it in every separate file.
- Will add support of no use color i.e., `settings set use-color false`
Can you please confirm weather the test cases good for now and the future plan looks okay? ;)
P.S: Currently The test case tests/Shell/Commands/command-target-modules-lookup is failing as it is not checking for ANSI color codes in the output. Once we update the `printRed` function, We'll add no use color in this test case and hopefully it will work fine.
https://github.com/llvm/llvm-project/pull/69422
More information about the lldb-commits
mailing list