Loading base/include/android-base/macros.h +15 −0 Original line number Diff line number Diff line Loading @@ -179,4 +179,19 @@ void UNUSED(const T&...) { } while (0) #endif // Current ABI string #if defined(__arm__) #define ABI_STRING "arm" #elif defined(__aarch64__) #define ABI_STRING "arm64" #elif defined(__i386__) #define ABI_STRING "x86" #elif defined(__x86_64__) #define ABI_STRING "x86_64" #elif defined(__mips__) && !defined(__LP64__) #define ABI_STRING "mips" #elif defined(__mips__) && defined(__LP64__) #define ABI_STRING "mips64" #endif #endif // ANDROID_BASE_MACROS_H debuggerd/libdebuggerd/include/utility.h +1 −18 Original line number Diff line number Diff line Loading @@ -24,26 +24,9 @@ #include <string> #include <android-base/macros.h> #include <backtrace/Backtrace.h> // Figure out the abi based on defined macros. #if defined(__arm__) #define ABI_STRING "arm" #elif defined(__aarch64__) #define ABI_STRING "arm64" #elif defined(__mips__) && !defined(__LP64__) #define ABI_STRING "mips" #elif defined(__mips__) && defined(__LP64__) #define ABI_STRING "mips64" #elif defined(__i386__) #define ABI_STRING "x86" #elif defined(__x86_64__) #define ABI_STRING "x86_64" #else #error "Unsupported ABI" #endif struct log_t{ // Tombstone file descriptor. int tfd; Loading libmemunreachable/MemUnreachable.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -479,23 +479,6 @@ std::string Leak::ToString(bool log_contents) const { return oss.str(); } // Figure out the abi based on defined macros. #if defined(__arm__) #define ABI_STRING "arm" #elif defined(__aarch64__) #define ABI_STRING "arm64" #elif defined(__mips__) && !defined(__LP64__) #define ABI_STRING "mips" #elif defined(__mips__) && defined(__LP64__) #define ABI_STRING "mips64" #elif defined(__i386__) #define ABI_STRING "x86" #elif defined(__x86_64__) #define ABI_STRING "x86_64" #else #error "Unsupported ABI" #endif std::string UnreachableMemoryInfo::ToString(bool log_contents) const { std::ostringstream oss; oss << " " << leak_bytes << " bytes in "; Loading libnativebridge/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ cc_library { host_supported: true, srcs: ["native_bridge.cc"], shared_libs: ["liblog"], shared_libs: ["liblog", "libbase"], export_include_dirs=["include"], Loading libnativebridge/native_bridge.cc +2 −18 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <cstring> #include <android-base/macros.h> #include <log/log.h> namespace android { Loading Loading @@ -243,29 +244,12 @@ bool LoadNativeBridge(const char* nb_library_filename, } } #if defined(__arm__) static const char* kRuntimeISA = "arm"; #elif defined(__aarch64__) static const char* kRuntimeISA = "arm64"; #elif defined(__mips__) && !defined(__LP64__) static const char* kRuntimeISA = "mips"; #elif defined(__mips__) && defined(__LP64__) static const char* kRuntimeISA = "mips64"; #elif defined(__i386__) static const char* kRuntimeISA = "x86"; #elif defined(__x86_64__) static const char* kRuntimeISA = "x86_64"; #else static const char* kRuntimeISA = "unknown"; #endif bool NeedsNativeBridge(const char* instruction_set) { if (instruction_set == nullptr) { ALOGE("Null instruction set in NeedsNativeBridge."); return false; } return strncmp(instruction_set, kRuntimeISA, strlen(kRuntimeISA) + 1) != 0; return strncmp(instruction_set, ABI_STRING, strlen(ABI_STRING) + 1) != 0; } #ifdef __APPLE__ Loading Loading
base/include/android-base/macros.h +15 −0 Original line number Diff line number Diff line Loading @@ -179,4 +179,19 @@ void UNUSED(const T&...) { } while (0) #endif // Current ABI string #if defined(__arm__) #define ABI_STRING "arm" #elif defined(__aarch64__) #define ABI_STRING "arm64" #elif defined(__i386__) #define ABI_STRING "x86" #elif defined(__x86_64__) #define ABI_STRING "x86_64" #elif defined(__mips__) && !defined(__LP64__) #define ABI_STRING "mips" #elif defined(__mips__) && defined(__LP64__) #define ABI_STRING "mips64" #endif #endif // ANDROID_BASE_MACROS_H
debuggerd/libdebuggerd/include/utility.h +1 −18 Original line number Diff line number Diff line Loading @@ -24,26 +24,9 @@ #include <string> #include <android-base/macros.h> #include <backtrace/Backtrace.h> // Figure out the abi based on defined macros. #if defined(__arm__) #define ABI_STRING "arm" #elif defined(__aarch64__) #define ABI_STRING "arm64" #elif defined(__mips__) && !defined(__LP64__) #define ABI_STRING "mips" #elif defined(__mips__) && defined(__LP64__) #define ABI_STRING "mips64" #elif defined(__i386__) #define ABI_STRING "x86" #elif defined(__x86_64__) #define ABI_STRING "x86_64" #else #error "Unsupported ABI" #endif struct log_t{ // Tombstone file descriptor. int tfd; Loading
libmemunreachable/MemUnreachable.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -479,23 +479,6 @@ std::string Leak::ToString(bool log_contents) const { return oss.str(); } // Figure out the abi based on defined macros. #if defined(__arm__) #define ABI_STRING "arm" #elif defined(__aarch64__) #define ABI_STRING "arm64" #elif defined(__mips__) && !defined(__LP64__) #define ABI_STRING "mips" #elif defined(__mips__) && defined(__LP64__) #define ABI_STRING "mips64" #elif defined(__i386__) #define ABI_STRING "x86" #elif defined(__x86_64__) #define ABI_STRING "x86_64" #else #error "Unsupported ABI" #endif std::string UnreachableMemoryInfo::ToString(bool log_contents) const { std::ostringstream oss; oss << " " << leak_bytes << " bytes in "; Loading
libnativebridge/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ cc_library { host_supported: true, srcs: ["native_bridge.cc"], shared_libs: ["liblog"], shared_libs: ["liblog", "libbase"], export_include_dirs=["include"], Loading
libnativebridge/native_bridge.cc +2 −18 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <cstring> #include <android-base/macros.h> #include <log/log.h> namespace android { Loading Loading @@ -243,29 +244,12 @@ bool LoadNativeBridge(const char* nb_library_filename, } } #if defined(__arm__) static const char* kRuntimeISA = "arm"; #elif defined(__aarch64__) static const char* kRuntimeISA = "arm64"; #elif defined(__mips__) && !defined(__LP64__) static const char* kRuntimeISA = "mips"; #elif defined(__mips__) && defined(__LP64__) static const char* kRuntimeISA = "mips64"; #elif defined(__i386__) static const char* kRuntimeISA = "x86"; #elif defined(__x86_64__) static const char* kRuntimeISA = "x86_64"; #else static const char* kRuntimeISA = "unknown"; #endif bool NeedsNativeBridge(const char* instruction_set) { if (instruction_set == nullptr) { ALOGE("Null instruction set in NeedsNativeBridge."); return false; } return strncmp(instruction_set, kRuntimeISA, strlen(kRuntimeISA) + 1) != 0; return strncmp(instruction_set, ABI_STRING, strlen(ABI_STRING) + 1) != 0; } #ifdef __APPLE__ Loading