[compiler-rt] [sanitizer_symbolizer] Symbolizer Markup for linux. (PR #65543)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 7 17:28:50 PDT 2023
================
@@ -66,38 +186,45 @@ bool Symbolizer::SymbolizeFrame(uptr addr, FrameInfo *info) { return false; }
// to render stack frames, but that should be changed to use
// RenderStackFrame.
SymbolizedStack *Symbolizer::SymbolizePC(uptr addr) {
+ SymbolizerTool *markupSymbolizer = tools_.front();
+ CHECK(markupSymbolizer);
+
SymbolizedStack *s = SymbolizedStack::New(addr);
- char buffer[kFormatFunctionMax];
- internal_snprintf(buffer, sizeof(buffer), kFormatFunction, addr);
- s->info.function = internal_strdup(buffer);
+ markupSymbolizer->SymbolizePC(addr, s);
return s;
}
// Always claim we succeeded, so that RenderDataInfo will be called.
bool Symbolizer::SymbolizeData(uptr addr, DataInfo *info) {
- info->Clear();
- info->start = addr;
- return true;
+ SymbolizerTool *markupSymbolizer = tools_.front();
+ CHECK(markupSymbolizer);
+ return markupSymbolizer->SymbolizeData(addr, info);
}
// We ignore the format argument to __sanitizer_symbolize_global.
void RenderData(InternalScopedString *buffer, const char *format,
- const DataInfo *DI, const char *strip_path_prefix) {
- buffer->append(kFormatData, DI->start);
+ const DataInfo *DI, bool symbolizer_markup,
+ const char *strip_path_prefix) {
+ RenderDataMarkup(buffer, format, DI, strip_path_prefix);
}
-bool RenderNeedsSymbolization(const char *format) { return false; }
+bool RenderNeedsSymbolization(const char *format, bool symbolizer_markup) {
+ return RenderNeedsSymbolizationMarkup(format);
+}
// We don't support the stack_trace_format flag at all.
void RenderFrame(InternalScopedString *buffer, const char *format, int frame_no,
uptr address, const AddressInfo *info, bool vs_style,
const char *strip_path_prefix) {
- CHECK(!RenderNeedsSymbolization(format));
- buffer->append(kFormatFrame, frame_no, address);
+ RenderFrameMarkup(buffer, format, frame_no, address, info, vs_style,
+ strip_path_prefix);
}
Symbolizer *Symbolizer::PlatformInit() {
- return new (symbolizer_allocator_) Symbolizer({});
+ IntrusiveList<SymbolizerTool> tools;
+ SymbolizerTool *tool = MarkupSymbolizer::get(&symbolizer_allocator_);
----------------
vitalybuka wrote:
can this use new() as well?
https://github.com/llvm/llvm-project/pull/65543
More information about the llvm-commits
mailing list