[Ada] fix traceback computation stop condition for ppc-aix

Message ID 20110803083306.GA30161@adacore.com
State New
Headers show

Commit Message

Arnaud Charlet Aug. 3, 2011, 8:33 a.m.
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  <hainque@adacore.com>

	* 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
+/* 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.  */
+  (((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.