Bug 1233666 - Remove hacks for getting frame pointer for x86/x64 gcc. draft
authorXidorn Quan <quanxunzhen@gmail.com>
Fri, 18 Dec 2015 21:22:36 +1100
changeset 316304 06583a7c8804cbbcac3d9f2b39af4a000b9d5e1a
parent 316294 51c7524a141d9e77737c3475ef70436f8da384be
child 512144 4cd7192795f915089b2ea00fe7d7287e466b2070
push id8528
push userxquan@mozilla.com
push dateFri, 18 Dec 2015 10:23:08 +0000
bugs1233666
milestone46.0a1
Bug 1233666 - Remove hacks for getting frame pointer for x86/x64 gcc.
mozglue/misc/StackWalk.cpp
--- a/mozglue/misc/StackWalk.cpp
+++ b/mozglue/misc/StackWalk.cpp
@@ -891,25 +891,17 @@ MozStackWalk(MozWalkStackCallback aCallb
              uint32_t aMaxFrames, void* aClosure, uintptr_t aThread,
              void* aPlatformData)
 {
   MOZ_ASSERT(!aThread);
   MOZ_ASSERT(!aPlatformData);
   StackWalkInitCriticalAddress();
 
   // Get the frame pointer
-  void** bp;
-#if defined(__i386)
-  __asm__("movl %%ebp, %0" : "=g"(bp));
-#else
-  // It would be nice if this worked uniformly, but at least on i386 and
-  // x86_64, it stopped working with gcc 4.1, because it points to the
-  // end of the saved registers instead of the start.
-  bp = (void**)__builtin_frame_address(0);
-#endif
+  void** bp = (void**)__builtin_frame_address(0);
 
   void* stackEnd;
 #if HAVE___LIBC_STACK_END
   stackEnd = __libc_stack_end;
 #else
   stackEnd = reinterpret_cast<void*>(-1);
 #endif
   return FramePointerStackWalk(aCallback, aSkipFrames, aMaxFrames,