From: Florian Mayer Date: Wed, 7 Jun 2023 00:25:55 +0000 (-0700) Subject: Revert "[Sanitizers] Remove BuildId from sanitizers stacktrace on X-Git-Tag: upstream/17.0.6~5906 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb49160765ed49b092b0157e2b6eed6930de3d22;p=platform%2Fupstream%2Fllvm.git Revert "[Sanitizers] Remove BuildId from sanitizers stacktrace on Breaks tests. This reverts commit fdb1a891b64c27522a2386a8025f8ad5c7e02bfb. --- diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.cpp index d3d1d26..1096d21 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.cpp @@ -218,9 +218,7 @@ void RenderFrame(InternalScopedString *buffer, const char *format, int frame_no, RenderModuleLocation(buffer, info->module, info->module_offset, info->module_arch, strip_path_prefix); -#ifndef SANITIZER_APPLE MaybeBuildIdToBuffer(*info, /*PrefixSpace=*/true, buffer); -#endif } else { buffer->append("()"); } @@ -233,9 +231,7 @@ void RenderFrame(InternalScopedString *buffer, const char *format, int frame_no, // Always strip the module name for %M. RenderModuleLocation(buffer, StripModuleName(info->module), info->module_offset, info->module_arch, ""); -#ifndef SANITIZER_APPLE MaybeBuildIdToBuffer(*info, /*PrefixSpace=*/true, buffer); -#endif } else { buffer->append("(%p)", (void *)address); } diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cpp index 489ef4d..62b34cd 100644 --- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cpp +++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cpp @@ -137,19 +137,11 @@ TEST(SanitizerStacktracePrinter, RenderFrame) { RenderFrame(&str, "%M", frame_no, info.address, &info, false); EXPECT_NE(nullptr, internal_strstr(str.data(), "(module+0x")); EXPECT_NE(nullptr, internal_strstr(str.data(), "200")); -#if SANITIZER_APPLE - EXPECT_EQ(nullptr, internal_strstr(str.data(), "BuildId: 5566")); -#else EXPECT_NE(nullptr, internal_strstr(str.data(), "BuildId: 5566")); -#endif str.clear(); RenderFrame(&str, "%L", frame_no, info.address, &info, false); -#if SANITIZER_APPLE - EXPECT_STREQ("(/path/to/module+0x200)", str.data()); -#else EXPECT_STREQ("(/path/to/module+0x200) (BuildId: 5566)", str.data()); -#endif str.clear(); RenderFrame(&str, "%b", frame_no, info.address, &info, false);