Hi,
I was trying to debug some issues in maxima and started from maxima
manual debug section.
It suggests to use dbl.el which is also included in gcl.
Now dbl.el was written many years ago and has an outdated call which can
be easily replaced
c/dbl.el.orig
324c324
< (string-to-number (match-string 2 string))))
---
(string-to-int (match-string 2 string))))
After that it works... almost.
Since there are issues in gcl_debug.lsp which I'm not able to track.
I start emacs.
I load dbl.el
1)
If I use GCL (GNU Common Lisp) 2.6.14 which comes with ubuntu
dbl.el does not work when I try to set a breakpoint with C-c space in
the window with the file I want to debug.
This happens because gcl_debug.lsp does not have the right output.
See below
2)
If I use GCL (GNU Common Lisp) 2.6.14
then a load gcl_debug.lsp which comes with gcl 2.7.1
then I load the file I want to debug as (si::nload "p0.lisp")
then in the window where I have loaded the file I want to debug
"p0.lisp" I set a breakpoint with C-x SPC
it works.
The reason is that gcl_debug.lsp has the right output.
This happens because the variable ar in the function BREAK-FUNCTION
knows about the name of the file I want to debug and outputs it.
If I do not load gcl_debug.lsp ar does not know the name...
See below.
igor@igor7a:~/hack/maxima/test_gcl$ gcl
GCL (GNU Common Lisp) 2.6.14 Fri Jan 13 10:47:56 AM EST 2023 CLtL1 git:
Version_2_6_15pre7
Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl)
Binary License: GPL due to GPL'ed components: (XGCL UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter
Use (help) to get some basic information on how to use GCL.
Temporary directory for compiler files:
/tmp/
(si::use-fast-links nil)
NIL
(si::nload "gcl_debug.lsp")
(trace si::dwim)
(trace si::break-function)
(trace si::make-break-point)
(trace si::insert-break-point)
(trace si::show-break-point)
;; Loading #p"/home/igor/hack/maxima/test_gcl/gcl_debug.lsp"
;; Finished loading #p"/home/igor/hack/maxima/test_gcl/gcl_debug.lsp"
T
(SYSTEM::DWIM)
(SYSTEM::BREAK-FUNCTION)
(SYSTEM::MAKE-BREAK-POINT)
(SYSTEM::INSERT-BREAK-POINT)
(SYSTEM::SHOW-BREAK-POINT)
(si::nload "p0.lisp")
;; Loading #p"/home/igor/hack/maxima/test_gcl/p0.lisp"
;; Finished loading #p"/home/igor/hack/maxima/test_gcl/p0.lisp"
T
1> (SYSTEM::BREAK-FUNCTION P1 9 T)
in br-fu: 1 : ar is #((/home/igor/hack/maxima/test_gcl/p0.lisp . 7) (X)
****** <=== the variable ar in the function BREAK-FUNCTION
****** BUT otherwise it is NIL . 7
(SETQ Y (+ X 2)) (SETQ Y (* Y Y)))
in br-fu: 2 ar is #((/home/igor/hack/maxima/test_gcl/p0.lisp . 7) (X)
(SETQ Y (+ X 2)) (SETQ Y (* Y Y)))
2> (SYSTEM::MAKE-BREAK-POINT P1
#(("/home/igor/hack/maxima/test_gcl/p0.lisp" . 7) (X)
(SETQ Y (+ X 2)) (SETQ Y (* Y Y)))
2)
<2 (SYSTEM::MAKE-BREAK-POINT
((SETQ Y (+ X 2)) "/home/igor/hack/maxima/test_gcl/p0.lisp"
9 P1))
2> (SYSTEM::INSERT-BREAK-POINT
((SETQ Y (+ X 2)) "/home/igor/hack/maxima/test_gcl/p0.lisp"
9 P1))
<2 (SYSTEM::INSERT-BREAK-POINT 0)
2> (SYSTEM::SHOW-BREAK-POINT 0)
Bkpt 0:(p0.lisp line 9)(line 2 of P1) <2 (SYSTEM::SHOW-BREAK-POINT
NIL)
****** HERE there is p0.lisp when it fails there is NIL *****
<1 (SYSTEM::BREAK-FUNCTION)
3)
If I compile gcl2.7.1 and use dbl.el
again ar does not know the name of the file I "si::nload"-ed
But what is even more puzzling is that it does not work even if I load
gcl_debug.lsp
Here is the output
igor@igor7a:~/hack/maxima/test_gcl$ ../gcl-2.7.1/unixport/saved_gcl
GCL (GNU Common Lisp) 2.7.1 Thu Apr 10 09:38:27 PM EDT 2025 CLtL1 git:
Version_2_7_1
Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl)
Binary License: GPL due to GPL'ed components: (XGCL READLINE UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter
Use (help) to get some basic information on how to use GCL.
Temporary directory for compiler files set to /tmp/
(si::use-fast-links nil)
NIL
(si::nload "gcl_debug.lsp")
(trace si::dwim)
(trace si::break-function)
(trace si::make-break-point)
(trace si::insert-break-point)
(trace si::show-break-point)
;; Loading #P"/home/igor/hack/maxima/test_gcl/gcl_debug.lsp"
;; Finished loading #P"/home/igor/hack/maxima/test_gcl/gcl_debug.lsp"
T
(SYSTEM::DWIM)
(SYSTEM::BREAK-FUNCTION)
(SYSTEM::MAKE-BREAK-POINT)
(SYSTEM::INSERT-BREAK-POINT)
(SYSTEM::SHOW-BREAK-POINT)
(si::nload "p0.lisp")
;; Loading #P"/home/igor/hack/maxima/test_gcl/p0.lisp"
;; Finished loading #P"/home/igor/hack/maxima/test_gcl/p0.lisp"
T
1> (SYSTEM::BREAK-FUNCTION P1 9 T)
in br-fu: 1 : ar is NIL
2> (SYSTEM::DWIM P1)
P1 has no line information <2 (SYSTEM::DWIM NIL)
in br-fu: 2 ar is NIL
No line info for P1 <1 (SYSTEM::BREAK-FUNCTION NIL)
NIL
Bests
Igor P