[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Backtraces to use macro information from edebug-specs?
From: |
Tobias C. Rittweiler |
Subject: |
Backtraces to use macro information from edebug-specs? |
Date: |
Fri, 13 Feb 2009 22:40:04 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.60 (gnu/linux) |
Let's take the following code
(defun foo (list)
(destructuring-bind (key slot1 slot2) list
(case key
(:foo (quux slot1)
(:bar (quux slot2))))))
(defun quux (x)
(error "QUUX -- %S" x))
Now evaluating
(foo '(:foo 23 42))
results in the following backtrace
Debugger entered--Lisp error: (error "QUUX -- 23")
signal(error ("QUUX -- 23"))
error("QUUX -- %S" 23)
quux(23)
(cond ((eql key ...) (quux slot1) (:bar ...)))
(case key (:foo (quux slot1) (:bar ...)))
(let* ((--cl-rest-- list) (key ...) (slot1 ...) (slot2 ...)) (case ...)
(progn (let* (... ... ... ...) (case key ...)))
(destructuring-bind (key slot1 slot2) list (case key (:foo ... ...)))
foo((:foo 23 42))
Given the information form edebug-specs (which are defined for all `cl'
macros), it may perhaps be possible to find out that
`quux(23)' comes from the body of case, but `(cond ((eql ...' doesn't.
`(case key ...' appears in the body of destructuring-bind, but the
`(let* ... ' and `(progn ...' do not.
As a result the backtrace could be presented as follows
Debugger entered--Lisp error: (error "QUUX -- 23")
signal(error ("QUUX -- 23"))
error("QUUX -- %S" 23)
quux(23)
(cond ((eql key ...) (quux slot1) (:bar ...)))
(case key (:foo (quux slot1) (:bar ...)))
(let* ((--cl-rest-- list) (key ...) (slot1 ...) (slot2 ...)) (case ...)
(progn (let* (... ... ... ...) (case key ...)))
(destructuring-bind (key slot1 slot2) list (case key (:foo ... ...)))
foo((:foo 23 42))
Of course, they may be better ways to do this, depending on how much
debug information is available.
Has anyone worked on something like that?
-T.
- Backtraces to use macro information from edebug-specs?,
Tobias C. Rittweiler <=