[libcxx-commits] [libcxxabi] [lldb] [llvm] [lldb] Add frame-format option to highlight function names in backtraces (PR #131836)

Michael Buch via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 9 09:39:43 PDT 2025


================
@@ -2074,6 +2076,64 @@ static const Definition *FindEntry(const llvm::StringRef &format_str,
   return parent;
 }
 
+/// Parses a single highlighting format specifier.
+///
+/// Example syntax for such specifier:
+/// \code
+/// ${function.name-with-args:%highlight_basename(ansi.fg.green)}
----------------
Michael137 wrote:

@adrian-prantl pointed out that another hurdle with this would be how to handle non-C++ languages with these fine-grained variables. We could make these variables C++ specific? (e.g., call them `${function.cxx-basename}`. Then language plugins themselves would handle them (like we do `FunctionNameWithArgs` already). We'll also need a mechanism to say "fall back to `${function.name-with-args}` if one of these variables can't be handled by the language" (which I don't think is possible at the moment).

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


More information about the libcxx-commits mailing list