[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dbl.el



    This may be a frequently asked question, but here it goes:
    In the doc directory in the AKCL distribution there is a elisp file
    called dbl.el; it appears that this is an interface to a lisp debugger
    similar to gdb for c. However, I am not quite sure how one is supposed
    to use it. There are instructions at the top of the file, but I do
    find them somehow cryptic. Has anybody used dbl (whatever that may
    be?)

The point of dbl.el is to provide a gnu emacs mode which allows
running of akcl in an emacs with two buffers displayed: one containing
an executing akcl, and the other containing source code.  At present
it just works for interpreted code, but it gives automatic display
when in the debugger of the current position in the source file.  You
may step execution line by line (using M-s and M-n), set a break point
by typing C-x space in the source file, examine the backtrace using
:bt (in the dbl buffer), and have the source window change to the code
for the ith frame by doing :fr i (in the dbl buffer).  It will only do
this display for files loaded with si::nload (same args as load).  It
is also in effect for code evaluated into akcl using M-C-x from a
lisp source buffer.  I find it incredibly useful when writing new lisp
code, or debugging programs with lots of source files.    You should
have a quite recent (say post 580 or 590) version of akcl, to run this.

There is some documentation under SOURCE-LEVEL-DEBUG in the doc/DOC file.
It may well be that the documentation is insufficient, since this tool
is really unlike any that lisp users have had before.  I would welcome
additional documentation, clarification or comments from users.

     Sample session:

M-x dbl
Name: akcl         <<in mini buffer>

<< in the newly created *dbl-akcl* buffer, invoke akcl >>
nicolas% akcl
AKCL (Austin Kyoto Common Lisp)  Version(1.606) Fri Nov  1 09:21:41 CST 1991
Contains Enhancements by W. Schelter

>(si::nload "/tmp/foo.lisp")
Loading /usr/tmp/foo.lisp
Finished loading /usr/tmp/foo.lisp
T
Comment<<{switch to foo.lisp buffer,
       go to second line of goo and type C-x space} to insert a break
       point at that point in the source:>>
>Bkpt 0:(foo.lisp line 8)(line 2 of GOO)

>(foo 1 2)
Bkpt 0:(/usr/tmp/foo.lisp line 8) 
dbl:>>:bt
#0   GOO {} [ihs=8]
#1   FOO {} (/usr/tmp/foo.lisp line 3)[ihs=6]
#2   EVAL {loc0=nil,loc1=nil,loc2=nil,loc3=(lambda-block foo (x y) ...),loc4=1,loc5=2} [ihs=5]
#3   TOP-LEVEL {} [ihs=4]
NIL
Comment:<<{ a little arrow appears at the second line of goo in the
           file foo.lisp, we wish to look where we are in frame 1   }>> 
dbl:>>:fr 1
#1   FOO {} (/usr/tmp/foo.lisp line 3)[ihs=6]
NIL

Comment:<<{ a little arrow appears at the 3rd line of foo,  since
           that is where we are in that frame}
dbl:>>:r
114

>
Inserting file /tmp/foo.lisp
---Begin File /tmp/foo.lisp---
(defun foo (x y)
  (setq x (+ x y))
  (setq x (goo x y))
  (+ x y))


(defun goo (x y)
  (setq x (* (+ x y) 22))
  (+ x y))




	---End File /tmp/foo.lisp---