Skip to content

Commit

Permalink
Remove frames from the backtrace that are in a swank package as those…
Browse files Browse the repository at this point in the history
… are misleading. Fixup locals display.
  • Loading branch information
Geo Carncross committed May 1, 2008
1 parent a8e47da commit 36a6053
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2008-04-30 Geo Carncross <geocar@geocar-laptop>

* swank-ecl.lisp (call-with-debugging-environment)
(in-swank-package-p): Remove frames from the backtrace that are
in a swank package as those are misleading. Fixup locals
display.

2008-04-29 Geo Carncross <geocar@gmail.com>

* swank-ecl.lisp: Backtrace and frame/eval improvements
Expand Down
15 changes: 13 additions & 2 deletions swank-ecl.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,17 @@

(defvar *backtrace* '())

(defun in-swank-package-p (x)
(if (consp x) (setf x (frame-name x)))
(when (symbolp x)
(and
(member (symbol-package x)
(list #.(find-package :swank)
#.(find-package :swank-backend)
#.(ignore-errors (find-package :swank-mop))
#.(ignore-errors (find-package :swank-loader))))
t)))

(defimplementation call-with-debugging-environment (debugger-loop-fn)
(declare (type function debugger-loop-fn))
(let* ((*tpl-commands* si::tpl-commands)
Expand All @@ -236,7 +247,7 @@
(*read-suppress* nil)
(*tpl-level* (1+ *tpl-level*))
(*backtrace* (loop for ihs from *ihs-base* below *ihs-top*
collect (list (si::ihs-fun (1+ ihs))
collect (list (si::ihs-fun ihs)
(si::ihs-env ihs)
nil))))
(loop for f from *frs-base* until *frs-top*
Expand All @@ -246,7 +257,7 @@
(name (si::frs-tag f)))
(unless (fixnump name)
(push name (third x)))))))
(setf *backtrace* (nreverse *backtrace*))
(setf *backtrace* (remove-if #'in-swank-package-p (nreverse *backtrace*)))
(set-break-env)
(set-current-ihs)
(let ((*ihs-base* *ihs-top*))
Expand Down

0 comments on commit 36a6053

Please sign in to comment.