2023-11-14 16:39:04 -08:00
|
|
|
//===-- sanitizer_symbolizer_markup_constants.h
|
|
|
|
//-----------------------------------===//
|
2018-05-11 23:52:19 +00:00
|
|
|
//
|
2019-01-19 08:50:56 +00:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2018-05-11 23:52:19 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file is shared between various sanitizers' runtime libraries.
|
|
|
|
//
|
2023-11-14 16:39:04 -08:00
|
|
|
// Define string formats and limits for the markup symbolizer.
|
2018-05-11 23:52:19 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2023-11-14 16:39:04 -08:00
|
|
|
#ifndef SANITIZER_SYMBOLIZER_MARKUP_CONSTANTS_H
|
|
|
|
#define SANITIZER_SYMBOLIZER_MARKUP_CONSTANTS_H
|
2018-05-11 23:52:19 +00:00
|
|
|
|
|
|
|
#include "sanitizer_internal_defs.h"
|
|
|
|
|
|
|
|
namespace __sanitizer {
|
|
|
|
|
|
|
|
// See the spec at:
|
|
|
|
// https://fuchsia.googlesource.com/zircon/+/master/docs/symbolizer_markup.md
|
|
|
|
|
|
|
|
// This is used by UBSan for type names, and by ASan for global variable names.
|
|
|
|
constexpr const char *kFormatDemangle = "{{{symbol:%s}}}";
|
|
|
|
constexpr uptr kFormatDemangleMax = 1024; // Arbitrary.
|
|
|
|
|
|
|
|
// Function name or equivalent from PC location.
|
|
|
|
constexpr const char *kFormatFunction = "{{{pc:%p}}}";
|
|
|
|
constexpr uptr kFormatFunctionMax = 64; // More than big enough for 64-bit hex.
|
|
|
|
|
|
|
|
// Global variable name or equivalent from data memory address.
|
|
|
|
constexpr const char *kFormatData = "{{{data:%p}}}";
|
|
|
|
|
|
|
|
// One frame in a backtrace (printed on a line by itself).
|
|
|
|
constexpr const char *kFormatFrame = "{{{bt:%u:%p}}}";
|
|
|
|
|
2023-12-04 10:28:41 -08:00
|
|
|
// Module contextual element.
|
|
|
|
constexpr const char *kFormatModule = "{{{module:%d:%s:elf:%s}}}";
|
|
|
|
|
|
|
|
// mmap for a module segment.
|
|
|
|
constexpr const char *kFormatMmap = "{{{mmap:%p:0x%x:load:%d:%s:0x%x}}}";
|
|
|
|
|
2018-11-22 02:00:44 +00:00
|
|
|
// Dump trigger element.
|
|
|
|
#define FORMAT_DUMPFILE "{{{dumpfile:%s:%s}}}"
|
|
|
|
|
2018-05-11 23:52:19 +00:00
|
|
|
} // namespace __sanitizer
|
|
|
|
|
2023-11-14 16:39:04 -08:00
|
|
|
#endif // SANITIZER_SYMBOLIZER_MARKUP_CONSTANTS_H
|