Automated rollback of commit 9f40d6d6f3.

PiperOrigin-RevId: 838084272
Change-Id: I8b1b15618e12cc17d85a71b7f5062b66ceaaf04f
This commit is contained in:
Abseil Team
2025-11-29 05:01:18 -08:00
committed by Copybara-Service
parent 9f40d6d6f3
commit 0cc960ece0
9 changed files with 243 additions and 43 deletions

View File

@@ -28,7 +28,7 @@
#include "absl/base/config.h"
#include "absl/debugging/internal/demangle_rust.h"
#if ABSL_INTERNAL_HAS_CXA_DEMANGLE
#ifdef ABSL_INTERNAL_HAS_CXA_DEMANGLE
#include <cxxabi.h>
#endif
@@ -2941,7 +2941,7 @@ std::string DemangleString(const char* mangled) {
std::string out;
int status = 0;
char* demangled = nullptr;
#if ABSL_INTERNAL_HAS_CXA_DEMANGLE
#ifdef ABSL_INTERNAL_HAS_CXA_DEMANGLE
demangled = abi::__cxa_demangle(mangled, nullptr, nullptr, &status);
#endif
if (status == 0 && demangled != nullptr) {

View File

@@ -94,15 +94,23 @@ TEST(StackTrace, HugeFrame) {
// This is a separate function to avoid inlining.
ABSL_ATTRIBUTE_NOINLINE static void FixupNoFixupEquivalenceNoInline() {
#if !ABSL_HAVE_ATTRIBUTE_WEAK
GTEST_SKIP() << "Need weak symbol support";
#endif
#if defined(__riscv)
GTEST_SKIP() << "Skipping test on RISC-V due to pre-existing failure";
#endif
#if defined(_WIN32)
const char* kSkipReason = "Need weak symbol support";
#elif defined(__riscv)
const char* kSkipReason =
"Skipping test on RISC-V due to pre-existing failure";
#elif defined(_WIN32)
// TODO(b/434184677): Add support for fixups on Windows if needed
GTEST_SKIP() << "Skipping test on Windows due to lack of support for fixups";
const char* kSkipReason =
"Skipping test on Windows due to lack of support for fixups";
#else
const char* kSkipReason = nullptr;
#endif
// This conditional is to avoid an unreachable code warning.
if (kSkipReason != nullptr) {
GTEST_SKIP() << kSkipReason;
}
bool can_rely_on_frame_pointers = false;
if (!can_rely_on_frame_pointers) {
GTEST_SKIP() << "Frame pointers are required, but not guaranteed in OSS";
@@ -233,13 +241,20 @@ TEST(StackTrace, FixupNoFixupEquivalence) { FixupNoFixupEquivalenceNoInline(); }
TEST(StackTrace, FixupLowStackUsage) {
#if !ABSL_HAVE_ATTRIBUTE_WEAK
GTEST_SKIP() << "Skipping test on MSVC due to weak symbols";
#endif
#if defined(_WIN32)
const char* kSkipReason = "Skipping test on MSVC due to weak symbols";
#elif defined(_WIN32)
// TODO(b/434184677): Add support for fixups on Windows if needed
GTEST_SKIP() << "Skipping test on Windows due to lack of support for fixups";
const char* kSkipReason =
"Skipping test on Windows due to lack of support for fixups";
#else
const char* kSkipReason = nullptr;
#endif
// This conditional is to avoid an unreachable code warning.
if (kSkipReason != nullptr) {
GTEST_SKIP() << kSkipReason;
}
const Cleanup restore_state([enable_fixup = g_enable_fixup,
fixup_calls = g_fixup_calls,
should_fixup_calls = g_should_fixup_calls]() {
@@ -276,13 +291,20 @@ TEST(StackTrace, FixupLowStackUsage) {
TEST(StackTrace, CustomUnwinderPerformsFixup) {
#if !ABSL_HAVE_ATTRIBUTE_WEAK
GTEST_SKIP() << "Need weak symbol support";
#endif
#if defined(_WIN32)
const char* kSkipReason = "Need weak symbol support";
#elif defined(_WIN32)
// TODO(b/434184677): Add support for fixups on Windows if needed
GTEST_SKIP() << "Skipping test on Windows due to lack of support for fixups";
const char* kSkipReason =
"Skipping test on Windows due to lack of support for fixups";
#else
const char* kSkipReason = nullptr;
#endif
// This conditional is to avoid an unreachable code warning.
if (kSkipReason != nullptr) {
GTEST_SKIP() << kSkipReason;
}
constexpr int kSkip = 1; // Skip our own frame, whose return PCs won't match
constexpr auto kStackCount = 1;