summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2023-02-07 21:14:32 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-02-07 21:14:32 +0000
commit021c12c12495e553eb7d92ce7eaac302cac10b1b (patch)
tree3d739922811bd9e6b67b8e4ab41b763ecfe71287
parentfddce2d2ce0320b54c824b6562e0cf1bdd8c0a26 (diff)
downloadunwinding-021c12c12495e553eb7d92ce7eaac302cac10b1b.tar.gz
Revert "Only enable rust demangling for some targets."
This reverts commit fddce2d2ce0320b54c824b6562e0cf1bdd8c0a26. Reason for revert: The original problem has been fixed, so linux_bionic now support rust properly. Change-Id: I9893658aa3ef25db57b500cc74449d6ae8b58ac7
-rw-r--r--libunwindstack/Android.bp12
-rw-r--r--libunwindstack/Demangle.cpp4
-rw-r--r--libunwindstack/tests/DemangleTest.cpp3
3 files changed, 4 insertions, 15 deletions
diff --git a/libunwindstack/Android.bp b/libunwindstack/Android.bp
index a0cd0f6..7a63a22 100644
--- a/libunwindstack/Android.bp
+++ b/libunwindstack/Android.bp
@@ -109,14 +109,6 @@ cc_defaults {
header_libs: ["bionic_libc_platform_headers"],
static_libs: ["libasync_safe"],
},
- android: {
- cflags: ["-DRUST_SUPPORTED"],
- whole_static_libs: ["librustc_demangle_static"],
- },
- linux_glibc: {
- cflags: ["-DRUST_SUPPORTED"],
- whole_static_libs: ["librustc_demangle_static"],
- },
},
arch: {
@@ -132,6 +124,10 @@ cc_defaults {
"libprocinfo",
],
+ whole_static_libs: [
+ "librustc_demangle_static",
+ ],
+
shared_libs: [
"libbase",
"liblog",
diff --git a/libunwindstack/Demangle.cpp b/libunwindstack/Demangle.cpp
index cf00de5..8d0bfd6 100644
--- a/libunwindstack/Demangle.cpp
+++ b/libunwindstack/Demangle.cpp
@@ -19,9 +19,7 @@
#include <string>
-#if defined(RUST_SUPPORTED)
#include <rustc_demangle.h>
-#endif
#include <unwindstack/Demangle.h>
@@ -36,11 +34,9 @@ std::string DemangleNameIfNeeded(const std::string& name) {
if (name[1] == 'Z') {
// Try to demangle C++ name.
demangled_str = abi::__cxa_demangle(name.c_str(), nullptr, nullptr, nullptr);
-#if defined(RUST_SUPPORTED)
} else if (name[1] == 'R') {
// Try to demangle rust name.
demangled_str = rustc_demangle(name.c_str(), nullptr, nullptr, nullptr);
-#endif
}
if (demangled_str == nullptr) {
diff --git a/libunwindstack/tests/DemangleTest.cpp b/libunwindstack/tests/DemangleTest.cpp
index 26ff436..3047b6e 100644
--- a/libunwindstack/tests/DemangleTest.cpp
+++ b/libunwindstack/tests/DemangleTest.cpp
@@ -38,9 +38,6 @@ TEST(DemangleTest, cxx_names) {
}
TEST(DemangleTest, rust_names) {
-#if defined(RUST_SUPPORTED)
- GTEST_SKIP() << "Rust not supported.";
-#endif
EXPECT_EQ("std::rt::lang_start_internal",
DemangleNameIfNeeded("_RNvNtCs2WRBrrl1bb1_3std2rt19lang_start_internal"));
EXPECT_EQ("profcollectd::main", DemangleNameIfNeeded("_RNvCs4VPobU5SDH_12profcollectd4main"));