Changeset 13918 for branches


Ignore:
Timestamp:
Jul 3, 2010, 1:22:01 PM (9 years ago)
Author:
gb
Message:

Minimal ARM stack-walking stuff.

Location:
branches/arm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/arm/level-1/arm-threads-utils.lisp

    r13889 r13918  
    2020  (cond ((fake-stack-frame-p p)
    2121         (%fake-stack-frame.next-sp p))
    22         ((fixnump p)
    23          (let ((backlink (%%frame-backlink p))
    24                (fake-frame
    25                 (if context (bt.fake-frames context) *fake-stack-frames*)))
    26            (loop
    27              (when (null fake-frame) (return backlink))
    28              (when (eq backlink (%fake-stack-frame.sp fake-frame))
    29                (return fake-frame))
    30              (setq fake-frame (%fake-stack-frame.link fake-frame)))))
     22        ((fixnump p) (%%frame-backlink p))
    3123        (t (error "~s is not a valid stack frame" p))))
    3224
     
    3527
    3628(defun catch-frame-sp (catch)
    37   (declare (ignorable catch))
    38   )
     29  (+ (strip-tag-to-fixnum catch)        ;catch frame is stack-consed
     30     arm::catch-frame.element-count))
     31
     32(defun fake-stack-frame-p (x)
     33  nil)
    3934
    4035(defun bottom-of-stack-p (p context)
     
    4641
    4742(defun lisp-frame-p (p context)
    48   (or (fake-stack-frame-p p)
    49       (locally (declare (fixnum p))
    50         (let ((next-frame (%frame-backlink p context)))
    51           (when (fake-stack-frame-p next-frame)
    52             (setq next-frame (%fake-stack-frame.sp next-frame)))
    53           (locally (declare (fixnum next-frame))
    54             (if (bottom-of-stack-p next-frame context)
    55               (values nil t)
    56               (and
    57                (eql (ash target::lisp-frame.size (- target::fixnum-shift))
    58                     (the fixnum (- next-frame p)))
    59                ;; EABI C functions keep their saved LRs where we save FN or 0
    60                ;; The saved LR of such a function would be fixnum-tagged and never 0.
    61                (let* ((fn (%fixnum-ref p target::lisp-frame.savefn)))
    62                  (or (eql fn 0) (typep fn 'function))))))))))
     43  (if (bottom-of-stack-p p context)
     44    (values nil t)
     45    (values (or (fake-stack-frame-p p)
     46                (eql (%fixnum-ref-natural p) arm::lisp-frame-marker)) nil)))
    6347
    6448
  • branches/arm/lib/arm-backtrace.lisp

    r13778 r13918  
    1616
    1717(in-package "CCL")
     18
     19(defun cfp-lfun (p)
     20  (if (and (typep p 'fixnum)
     21           (lisp-frame-p p nil))
     22    (%cfp-lfun p)))
     23
     24(defun catch-csp-p (p context)
     25  (let ((catch (if context
     26                 (bt.top-catch context)
     27                 (%catch-top (%current-tcr)))))
     28    (loop
     29      (when (null catch) (return nil))
     30      (let ((sp (catch-frame-sp catch)))
     31        (when (eql sp p)
     32          (return t)))
     33      (setq catch (next-catch catch)))))
Note: See TracChangeset for help on using the changeset viewer.