[PATCH] [PowerPC]Adapt fast stack unwinding to work for Power.

Kostya Serebryany kcc at google.com
Wed May 6 14:15:24 PDT 2015


I know this is extremely hard in this case, but please try to make a test for this change.


================
Comment at: /home/seurer/llvm/llvm-test/projects/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h:50
@@ -50,1 +49,3 @@
 
+#if defined(__powerpc__) || defined(__powerpc64__)
+  static const int OFFSET_TO_PC_IN_FRAME = 2;
----------------
Does this have to be in the header? 

================
Comment at: /home/seurer/llvm/llvm-test/projects/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h:51
@@ +50,3 @@
+#if defined(__powerpc__) || defined(__powerpc64__)
+  static const int OFFSET_TO_PC_IN_FRAME = 2;
+  // The stack will include functions called after the function that
----------------
if you need constants like this, name them kOffsetToPcInFrame

================
Comment at: /home/seurer/llvm/llvm-test/projects/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h:56
@@ +55,3 @@
+  // frames.
+  static const bool FAST_UNWIND_SHOULD_POP_FRAMES_TO_PC = true;
+#else
----------------
hfinkel wrote:
> Kostya, can you please look at this (or ping the appropriate person)?
> 
> I talked to Bill about this offline, and he explained that there is nothing PowerPC-specific about needing to pop these extra frames to match the regular unwinder (he says the same is needed on all platforms). Maybe we should be changing this in general, or this is a deliberate optimization that PowerPC should just match (and adjust test cases as necessary?).
> 
I wrote this code initially, samsonov@ and eugenis@ touched it a few times. 
This is probably the most fragile part in the entire family of tools -- hard to test, easy to break. 

Since I don't know what problem you are solving on PPC it's hard for me to comment. 
Can you describe the actual problem (difference from x86 case)?

http://reviews.llvm.org/D9259

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list