This change adjusts the traceback stop condition for ppc-aix to stop
at null return addresses, sometimes encountered alone (with the associated
backchain pointer not null) to indicate a toplevel frame.
Tested on x86_64-pc-linux-gnu, committed on trunk
2011-08-03 Olivier Hainque <[email protected]>
* tracebak.c (STOP_FRAME ppc AIX): Stop at null return address as well.
Index: tracebak.c
===================================================================
--- tracebak.c (revision 176998)
+++ tracebak.c (working copy)
@@ -219,8 +219,15 @@
#define FRAME_OFFSET(FP) 0
#define PC_ADJUST -4
-#define STOP_FRAME(CURRENT, TOP_STACK) ((void *) (CURRENT) < (TOP_STACK))
+/* Eventhough the base PPC ABI states that a toplevel frame entry
+ should to feature a null backchain, AIX might expose a null return
+ address instead. */
+
+#define STOP_FRAME(CURRENT, TOP_STACK) \
+ (((void *) (CURRENT) < (TOP_STACK)) \
+ || (CURRENT)->return_address == NULL)
+
/* The PPC ABI has an interesting specificity: the return address saved by a
function is located in it's caller's frame, and the save operation only
takes place if the function performs a call.