From 7dc98b7fb33890e9f5ce528075d5e3cf96fb6c38 Mon Sep 17 00:00:00 2001 From: Alastair Bridgewater Date: Wed, 30 Apr 2014 23:16:44 -0400 Subject: [PATCH] Fix ARM backtrace for "escaped" frames in assembly-routines or trampolines. * This was two things, one of which was being able to pick out the correct return address for when an assembly routine is active (which is defined on a per-arch basis, but is USUALLY something to do with an interior-pointer register), and the other of which was compensating for using a stack slot instead of reg_LRA to pass our LRAs around during funcall. --- src/assembly/arm/support.lisp | 3 +++ src/code/debug-int.lisp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/assembly/arm/support.lisp b/src/assembly/arm/support.lisp index 1d07af537..d814961bb 100644 --- a/src/assembly/arm/support.lisp +++ b/src/assembly/arm/support.lisp @@ -74,3 +74,6 @@ :offset lip-offset) :offset 2))) (:none))) + +(defun return-machine-address (scp) + (context-register scp lr-offset)) diff --git a/src/code/debug-int.lisp b/src/code/debug-int.lisp index 2888b9e7b..267b4342a 100644 --- a/src/code/debug-int.lisp +++ b/src/code/debug-int.lisp @@ -934,7 +934,6 @@ (- (get-lisp-obj-address code) sb!vm:other-pointer-lowtag) code-header-len))) - #!-arm ;; FIXME: This is wrong for ARM. (let ((code-size (* (code-header-ref code sb!vm:code-code-size-slot) sb!vm:n-word-bytes))) @@ -956,7 +955,10 @@ (sap-int (sb!vm:context-pc scp)) code (%code-entry-points code) + #!-arm (sb!vm:context-register scp sb!vm::lra-offset) + #!+arm + (stack-ref frame-pointer lra-save-offset) computed-return)) ;; We failed to pinpoint where PC is, but set ;; pc-offset to 0 to keep the backtrace from -- 2.11.4.GIT