Index: /branches/arm/level-1/arm-threads-utils.lisp
===================================================================
--- /branches/arm/level-1/arm-threads-utils.lisp	(revision 13917)
+++ /branches/arm/level-1/arm-threads-utils.lisp	(revision 13918)
@@ -20,13 +20,5 @@
   (cond ((fake-stack-frame-p p)
          (%fake-stack-frame.next-sp p))
-        ((fixnump p)
-         (let ((backlink (%%frame-backlink p))
-               (fake-frame
-                (if context (bt.fake-frames context) *fake-stack-frames*)))
-           (loop
-             (when (null fake-frame) (return backlink))
-             (when (eq backlink (%fake-stack-frame.sp fake-frame))
-               (return fake-frame))
-             (setq fake-frame (%fake-stack-frame.link fake-frame)))))
+        ((fixnump p) (%%frame-backlink p))
         (t (error "~s is not a valid stack frame" p))))
 
@@ -35,6 +27,9 @@
 
 (defun catch-frame-sp (catch)
-  (declare (ignorable catch))
-  )
+  (+ (strip-tag-to-fixnum catch)        ;catch frame is stack-consed
+     arm::catch-frame.element-count))
+
+(defun fake-stack-frame-p (x)
+  nil)
 
 (defun bottom-of-stack-p (p context)
@@ -46,19 +41,8 @@
 
 (defun lisp-frame-p (p context)
-  (or (fake-stack-frame-p p)
-      (locally (declare (fixnum p))
-        (let ((next-frame (%frame-backlink p context)))
-          (when (fake-stack-frame-p next-frame)
-            (setq next-frame (%fake-stack-frame.sp next-frame)))
-          (locally (declare (fixnum next-frame))
-            (if (bottom-of-stack-p next-frame context)
-              (values nil t)
-              (and
-               (eql (ash target::lisp-frame.size (- target::fixnum-shift))
-                    (the fixnum (- next-frame p)))
-               ;; EABI C functions keep their saved LRs where we save FN or 0
-               ;; The saved LR of such a function would be fixnum-tagged and never 0.
-               (let* ((fn (%fixnum-ref p target::lisp-frame.savefn)))
-                 (or (eql fn 0) (typep fn 'function))))))))))
+  (if (bottom-of-stack-p p context)
+    (values nil t)
+    (values (or (fake-stack-frame-p p)
+                (eql (%fixnum-ref-natural p) arm::lisp-frame-marker)) nil)))
 
 
Index: /branches/arm/lib/arm-backtrace.lisp
===================================================================
--- /branches/arm/lib/arm-backtrace.lisp	(revision 13917)
+++ /branches/arm/lib/arm-backtrace.lisp	(revision 13918)
@@ -16,2 +16,18 @@
 
 (in-package "CCL")
+
+(defun cfp-lfun (p)
+  (if (and (typep p 'fixnum)
+           (lisp-frame-p p nil))
+    (%cfp-lfun p)))
+
+(defun catch-csp-p (p context)
+  (let ((catch (if context
+                 (bt.top-catch context)
+                 (%catch-top (%current-tcr)))))
+    (loop
+      (when (null catch) (return nil))
+      (let ((sp (catch-frame-sp catch)))
+        (when (eql sp p)
+          (return t)))
+      (setq catch (next-catch catch)))))
