[clang-tools-extra] [sanitizer_symbolizer] Symbolizer Markup for linux (PR #66126)

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 12 23:57:52 PDT 2023


=?utf-8?q?Andrés?= Villegas <andresvi at google.com>,
=?utf-8?q?Andrés?= Villegas <andresvi at google.com>,
=?utf-8?q?Andrés?= Villegas <andresvi at google.com>,
=?utf-8?q?Andrés?= Villegas <andresvi at google.com>


petrhosek wrote:

Could we move functions in [compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.h](https://github.com/llvm/llvm-project/blob/231aa0f2120552b474bf86d5ff6721a6c555fdc3/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.h) into a class, e.g. `StackTracePrinter`, of which there would be two implementations, e.g. `FormattedStackTracePrinter` and `MarkupStackTracePrinter`. That would eliminate a lot of these cases:

```
if (common_flags()->enable_symbolizer_markup)
  RenderFooMarkup(...)
else
  RenderFoo(...)
```

Instead we would end up with something like:

```
StackTracePrinter::GetOrInit()->RenderFoo(...)
```

This could be done as two changes. First to introduce the new class and refactor all existing use cases. Second to introduce the markup implementation. Each of these changes should be easier to review than the current patch.

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


More information about the cfe-commits mailing list