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

José Lira Junior via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 14 09:45:49 PST 2023


junior-jl wrote:

In this last commit, your suggestions on the algorithm were done (the use of `remaining` instead of `text` and `drop_front`. Also, the method is now on `Stream` and called `PutCStringColorHighlighted` as you recommended. It looks way better that way.

> Then later use that with strm.printf like this: https://godbolt.org/z/zG6Tsn4WP

This is new for me. Thank you!

In `Stream.h`, we tried to keep up with the file standard. Hence, the comments:

```cpp
  /// Output a C string to the stream with color highlighting.
  ///
  /// Print a C string \a text to the stream, applying color highlighting to
  /// the specified \a pattern within the string.
  ///
  /// \param[in] text
  ///     The string to be output to the stream.
  ///
  /// \param[in] pattern
  ///     The portion of the \a text string to be colorized for highlighting.
  void PutCStringColorHighlighted(llvm::StringRef text, const char *pattern);
```

Please let me know if we should drop these.

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


More information about the lldb-commits mailing list