diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup.cpp index b2a1069a9a61c..31d91ef3c7392 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup.cpp @@ -28,7 +28,7 @@ void MarkupStackTracePrinter::RenderData(InternalScopedString *buffer, const char *format, const DataInfo *DI, const char *strip_path_prefix) { RenderContext(buffer); - buffer->AppendF(kFormatData, DI->start); + buffer->AppendF(kFormatData, reinterpret_cast(DI->start)); } bool MarkupStackTracePrinter::RenderNeedsSymbolization(const char *format) { @@ -43,12 +43,13 @@ void MarkupStackTracePrinter::RenderFrame(InternalScopedString *buffer, const char *strip_path_prefix) { CHECK(!RenderNeedsSymbolization(format)); RenderContext(buffer); - buffer->AppendF(kFormatFrame, frame_no, address); + buffer->AppendF(kFormatFrame, frame_no, reinterpret_cast(address)); } bool MarkupSymbolizerTool::SymbolizePC(uptr addr, SymbolizedStack *stack) { char buffer[kFormatFunctionMax]; - internal_snprintf(buffer, sizeof(buffer), kFormatFunction, addr); + internal_snprintf(buffer, sizeof(buffer), kFormatFunction, + reinterpret_cast(addr)); stack->info.function = internal_strdup(buffer); return true; } @@ -118,7 +119,8 @@ static void RenderMmaps(InternalScopedString *buffer, // module.base_address == dlpi_addr // range.beg == dlpi_addr + p_vaddr // relative address == p_vaddr == range.beg - module.base_address - buffer->AppendF(kFormatMmap, range.beg, range.end - range.beg, moduleId, + buffer->AppendF(kFormatMmap, reinterpret_cast(range.beg), + range.end - range.beg, static_cast(moduleId), accessBuffer.data(), range.beg - module.base_address()); buffer->Append("\n"); diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup_constants.h b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup_constants.h index 83643504e1289..a43661eaecf2f 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup_constants.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup_constants.h @@ -33,13 +33,13 @@ constexpr uptr kFormatFunctionMax = 64; // More than big enough for 64-bit hex. constexpr const char *kFormatData = "{{{data:%p}}}"; // One frame in a backtrace (printed on a line by itself). -constexpr const char *kFormatFrame = "{{{bt:%u:%p}}}"; +constexpr const char *kFormatFrame = "{{{bt:%d:%p}}}"; // Module contextual element. -constexpr const char *kFormatModule = "{{{module:%d:%s:elf:%s}}}"; +constexpr const char *kFormatModule = "{{{module:%zu:%s:elf:%s}}}"; // mmap for a module segment. -constexpr const char *kFormatMmap = "{{{mmap:%p:0x%x:load:%d:%s:0x%x}}}"; +constexpr const char *kFormatMmap = "{{{mmap:%p:0x%zx:load:%d:%s:0x%zx}}}"; // Dump trigger element. #define FORMAT_DUMPFILE "{{{dumpfile:%s:%s}}}"