sanitizer_symbolizer_markup_constants.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //===-- sanitizer_symbolizer_markup_constants.h
  2. //-----------------------------------===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // This file is shared between various sanitizers' runtime libraries.
  11. //
  12. // Define string formats and limits for the markup symbolizer.
  13. //===----------------------------------------------------------------------===//
  14. #ifndef SANITIZER_SYMBOLIZER_MARKUP_CONSTANTS_H
  15. #define SANITIZER_SYMBOLIZER_MARKUP_CONSTANTS_H
  16. #include "sanitizer_internal_defs.h"
  17. namespace __sanitizer {
  18. // See the spec at:
  19. // https://fuchsia.googlesource.com/zircon/+/master/docs/symbolizer_markup.md
  20. // This is used by UBSan for type names, and by ASan for global variable names.
  21. constexpr const char *kFormatDemangle = "{{{symbol:%s}}}";
  22. constexpr uptr kFormatDemangleMax = 1024; // Arbitrary.
  23. // Function name or equivalent from PC location.
  24. constexpr const char *kFormatFunction = "{{{pc:%p}}}";
  25. constexpr uptr kFormatFunctionMax = 64; // More than big enough for 64-bit hex.
  26. // Global variable name or equivalent from data memory address.
  27. constexpr const char *kFormatData = "{{{data:%p}}}";
  28. // One frame in a backtrace (printed on a line by itself).
  29. constexpr const char *kFormatFrame = "{{{bt:%u:%p}}}";
  30. // Module contextual element.
  31. constexpr const char *kFormatModule = "{{{module:%d:%s:elf:%s}}}";
  32. // mmap for a module segment.
  33. constexpr const char *kFormatMmap = "{{{mmap:%p:0x%x:load:%d:%s:0x%x}}}";
  34. // Dump trigger element.
  35. #define FORMAT_DUMPFILE "{{{dumpfile:%s:%s}}}"
  36. } // namespace __sanitizer
  37. #endif // SANITIZER_SYMBOLIZER_MARKUP_CONSTANTS_H