/[slime]/slime/swank.lisp
ViewVC logotype

Diff of /slime/swank.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.585 by trittweiler, Wed Sep 10 23:10:45 2008 UTC revision 1.586 by trittweiler, Fri Sep 12 12:27:37 2008 UTC
# Line 2245  format suitable for Emacs." Line 2245  format suitable for Emacs."
2245     (list :debug-activate (current-thread-id) *sldb-level* t)))     (list :debug-activate (current-thread-id) *sldb-level* t)))
2246    
2247  (defslimefun backtrace (start end)  (defslimefun backtrace (start end)
2248    "Return a list ((I FRAME) ...) of frames from START to END.    "Return a list ((I FRAME PLIST) ...) of frames from START to END.
2249  I is an integer describing and FRAME a string."  
2250    (loop for frame in (compute-backtrace start end)  I is an integer, and can be used to reference the corresponding frame
2251          for i from start collect  from Emacs; FRAME is a string representation of an implementation's
2252          (list i  frame."
2253                (call/truncated-output-to-string    (flet ((print-swank-frame-to-string (frame)
2254                 100             (call/truncated-output-to-string
2255                 (lambda (stream)              100
2256                   (handler-case              (lambda (stream)
2257                       (with-bindings *backtrace-printer-bindings*                (handler-case
2258                         (print-frame frame stream))                    (with-bindings *backtrace-printer-bindings*
2259                     (t ()                      (print-swank-frame frame stream))
2260                       (format stream "[error printing frame]"))))))))                  (t ()
2261                      (format stream "[error printing frame]")))))))
2262        (loop for frame in (compute-backtrace start end)
2263              for i from start collect
2264              (list i (print-swank-frame-to-string frame)
2265                    (list :restartable (let ((r (swank-frame.restartable frame)))
2266                                         (check-type r (member nil t :unknown))
2267                                         r))))))
2268    
2269  (defslimefun debugger-info-for-emacs (start end)  (defslimefun debugger-info-for-emacs (start end)
2270    "Return debugger state, with stack frames from START to END.    "Return debugger state, with stack frames from START to END.
# Line 2266  The result is a list: Line 2273  The result is a list:
2273  where  where
2274    condition   ::= (description type [extra])    condition   ::= (description type [extra])
2275    restart     ::= (name description)    restart     ::= (name description)
2276    stack-frame ::= (number description)    stack-frame ::= (number description [plist])
2277    extra       ::= (:references and other random things)    extra       ::= (:references and other random things)
2278    cont        ::= continutation    cont        ::= continutation
2279      plist       ::= (:restartable {nil | t | :unknown})
2280    
2281  condition---a pair of strings: message, and type.  If show-source is  condition---a pair of strings: message, and type.  If show-source is
2282  not nil it is a frame number for which the source should be displayed.  not nil it is a frame number for which the source should be displayed.
2283    
# Line 2288  Operation was KERNEL::DIVISION, operands Line 2297  Operation was KERNEL::DIVISION, operands
2297     \"[Condition of type DIVISION-BY-ZERO]\")     \"[Condition of type DIVISION-BY-ZERO]\")
2298    ((\"ABORT\" \"Return to Slime toplevel.\")    ((\"ABORT\" \"Return to Slime toplevel.\")
2299     (\"ABORT\" \"Return to Top-Level.\"))     (\"ABORT\" \"Return to Top-Level.\"))
2300    ((0 \"(KERNEL::INTEGER-/-INTEGER 1 0)\"))    ((0 \"(KERNEL::INTEGER-/-INTEGER 1 0)\" (:restartable nil)))
2301    (4))"    (4))"
2302    (list (debugger-condition-for-emacs)    (list (debugger-condition-for-emacs)
2303          (format-restarts-for-emacs)          (format-restarts-for-emacs)

Legend:
Removed from v.1.585  
changed lines
  Added in v.1.586

  ViewVC Help
Powered by ViewVC 1.1.5