diff options
author | Kuba Mracek <mracek@apple.com> | 2017-01-06 21:45:05 +0000 |
---|---|---|
committer | Kuba Mracek <mracek@apple.com> | 2017-01-06 21:45:05 +0000 |
commit | d46b929d4f2835873f6559eb213145ecc66c56ee (patch) | |
tree | 432623d639a2f6876a9917bf9330a06253f8a05b /lib/sanitizer_common/tests | |
parent | f752e5f2ac44590a9379a9c0e2508499be894601 (diff) |
[sanitizer] Use architecture/slice information when symbolizing fat Mach-O files on Darwin
This patch starts passing architecture information about a module to llvm-symbolizer and into text reports. This fixes the longstanding x86_64/x86_64h mismatch issue on Darwin.
Differential Revision: https://reviews.llvm.org/D27390
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291287 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/tests')
-rw-r--r-- | lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cc b/lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cc index 05796fcbf..405f8d86e 100644 --- a/lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cc +++ b/lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cc @@ -52,13 +52,18 @@ TEST(SanitizerStacktracePrinter, RenderSourceLocation) { TEST(SanitizerStacktracePrinter, RenderModuleLocation) { InternalScopedString str(128); - RenderModuleLocation(&str, "/dir/exe", 0x123, ""); + RenderModuleLocation(&str, "/dir/exe", 0x123, kModuleArchUnknown, ""); EXPECT_STREQ("(/dir/exe+0x123)", str.data()); // Check that we strip file prefix if necessary. str.clear(); - RenderModuleLocation(&str, "/dir/exe", 0x123, "/dir/"); + RenderModuleLocation(&str, "/dir/exe", 0x123, kModuleArchUnknown, "/dir/"); EXPECT_STREQ("(exe+0x123)", str.data()); + + // Check that we render the arch. + str.clear(); + RenderModuleLocation(&str, "/dir/exe", 0x123, kModuleArchX86_64H, "/dir/"); + EXPECT_STREQ("(exe:x86_64h+0x123)", str.data()); } TEST(SanitizerStacktracePrinter, RenderFrame) { |