diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 21:49:04 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 21:49:04 +0200 |
commit | 39dac57259cff8b61db0b22cb2ad0a8adb02692e (patch) | |
tree | 52a026cc8c22793eb17fd0f5e22adce1ae08a1dd /mozglue/misc/StackWalk.cpp | |
parent | a1cce3b2b00bbd9f4983013ddd8934a7bccb9e99 (diff) | |
parent | c2d9ab62f3d097c9e0e00184cab1f546554f5eaa (diff) | |
download | UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.gz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.lz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.xz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.zip |
Merge branch 'redwood' into 28.9-platform
Diffstat (limited to 'mozglue/misc/StackWalk.cpp')
-rw-r--r-- | mozglue/misc/StackWalk.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/mozglue/misc/StackWalk.cpp b/mozglue/misc/StackWalk.cpp index bb23b922a..9d0df08f2 100644 --- a/mozglue/misc/StackWalk.cpp +++ b/mozglue/misc/StackWalk.cpp @@ -59,12 +59,6 @@ static CriticalAddress gCriticalAddress; extern MOZ_EXPORT void* __libc_stack_end; // from ld-linux.so #endif -#ifdef ANDROID -#include <algorithm> -#include <unistd.h> -#include <pthread.h> -#endif - #if MOZ_STACKWALK_SUPPORTS_MACOSX #include <pthread.h> #include <sys/errno.h> @@ -931,31 +925,6 @@ MozStackWalk(MozWalkStackCallback aCallback, uint32_t aSkipFrames, stackEnd = __libc_stack_end; #elif defined(XP_DARWIN) stackEnd = pthread_get_stackaddr_np(pthread_self()); -#elif defined(ANDROID) - pthread_attr_t sattr; - pthread_attr_init(&sattr); - pthread_getattr_np(pthread_self(), &sattr); - void* stackBase = stackEnd = nullptr; - size_t stackSize = 0; - if (gettid() != getpid()) { - // bionic's pthread_attr_getstack doesn't tell the truth for the main - // thread (see bug 846670). So don't use it for the main thread. - if (!pthread_attr_getstack(&sattr, &stackBase, &stackSize)) { - stackEnd = static_cast<char*>(stackBase) + stackSize; - } else { - stackEnd = nullptr; - } - } - if (!stackEnd) { - // So consider the current frame pointer + an arbitrary size of 8MB - // (modulo overflow ; not really arbitrary as it's the default stack - // size for the main thread) if pthread_attr_getstack failed for - // some reason (or was skipped). - static const uintptr_t kMaxStackSize = 8 * 1024 * 1024; - uintptr_t maxStackStart = uintptr_t(-1) - kMaxStackSize; - uintptr_t stackStart = std::max(maxStackStart, uintptr_t(bp)); - stackEnd = reinterpret_cast<void*>(stackStart + kMaxStackSize); - } #else # error Unsupported configuration #endif |