Hi,
I cannot seem to get sldb-show-source to work using sbcl.
I have tried with recent Ubuntu 10.04 packages: emacs 23.1+1-4ubuntu7 slime 1:20090908-1 sbcl 1:1.0.29.11-1ubuntu1
I also tried a test machine where I downloaded: sbcl 1.0.42 slime snapshot 2010-08-31
On my test setup: I wrote some trivial lisp code that included a (break) to start the debugger. When running sldb-show-source on a frame from my source file, I get the following in my REPL output: "WARNING: inconsistent form-number-translations" and I also get this in the emacs message echo area: "error in process filter: Beginning of buffer"
Any idea why this is happening?
Thanks,
Ryan
* Ryan Taylor [2010-09-01 03:29] writes:
Hi,
I cannot seem to get sldb-show-source to work using sbcl.
I have tried with recent Ubuntu 10.04 packages: emacs 23.1+1-4ubuntu7 slime 1:20090908-1 sbcl 1:1.0.29.11-1ubuntu1
I also tried a test machine where I downloaded: sbcl 1.0.42 slime snapshot 2010-08-31
On my test setup: I wrote some trivial lisp code that included a (break) to start the debugger. When running sldb-show-source on a frame from my source file, I get the following in my REPL output: "WARNING: inconsistent form-number-translations" and I also get this in the emacs message echo area: "error in process filter: Beginning of buffer"
Any idea why this is happening?
Hard to tell without seeing the function with the (break). A problem may be that (break) is in tail position, so that the frame of your function is overwritten before the debugger is called and the debugger tries to find the source in some SBCL-internal function and the source of those might be inconsistent with debug info in the fasl file. Sometimes it helps to insert "(break) nil" to disable tail call optimization of BREAK. [Arguably optimizing calls to BREAK counts as compiler bug.]
Helmut
Tail calls do not seem to be the problem; the problem does not seem dependent on particular constructs, I have seen it happen in a variety of situations. Here is an example that does not work.
Source file breaktest.lisp: (declaim (optimize (debug 3))) (defun foo (bar) (print bar) (print bar) (break) (print bar))) (defun foo-caller () (foo "hello") (print "caller"))
From the REPL, I do: CL-USER> (load "/home/ryan/breaktest.lisp") T CL-USER> (foo-caller)
When I try sbdl-show-source on foo-caller or foo in the call stack, I get the errors mentioned in my previous email.
If I remove the debug optimization line, then I get errors like this with the new sbcl/slime versions: "Error: DEFINITION-SOURCE of function FOO did not contain meaningful information"
--- On Wed, 9/1/10, Helmut Eller heller@common-lisp.net wrote:
From: Helmut Eller heller@common-lisp.net Subject: Re: [slime-devel] Problem with debugger view source To: slime-devel@common-lisp.net Date: Wednesday, September 1, 2010, 4:03 AM
- Ryan Taylor [2010-09-01 03:29]
writes:
Hi,
I cannot seem to get sldb-show-source to work using
sbcl.
I have tried with recent Ubuntu 10.04 packages: emacs 23.1+1-4ubuntu7 slime 1:20090908-1 sbcl 1:1.0.29.11-1ubuntu1
I also tried a test machine where I downloaded: sbcl 1.0.42 slime snapshot 2010-08-31
On my test setup: I wrote some trivial lisp code
that included a (break) to start the debugger. When running sldb-show-source on a frame from my source file, I get the following in my REPL output:
"WARNING: inconsistent
form-number-translations"
and I also get this in the emacs message echo area: "error in process filter: Beginning
of buffer"
Any idea why this is happening?
Hard to tell without seeing the function with the (break). A problem may be that (break) is in tail position, so that the frame of your function is overwritten before the debugger is called and the debugger tries to find the source in some SBCL-internal function and the source of those might be inconsistent with debug info in the fasl file. Sometimes it helps to insert "(break) nil" to disable tail call optimization of BREAK. [Arguably optimizing calls to BREAK counts as compiler bug.]
Helmut
slime-devel site list slime-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/slime-devel
* Ryan Taylor [2010-09-01 12:42] writes:
Tail calls do not seem to be the problem; the problem does not seem dependent on particular constructs, I have seen it happen in a variety of situations. Here is an example that does not work.
Source file breaktest.lisp: (declaim (optimize (debug 3))) (defun foo (bar) (print bar) (print bar) (break) (print bar)))
^ This seems superflous, but probably not the problem.
(defun foo-caller () (foo "hello") (print "caller"))
From the REPL, I do: CL-USER> (load "/home/ryan/breaktest.lisp") T CL-USER> (foo-caller)
When I try sbdl-show-source on foo-caller or foo in the call stack, I get the errors mentioned in my previous email.
I see some warnings and sldb-show-source brings me to the (declaim (optimize (debug 3))) form which is also pretty wrong.
When loading the fasl file (load (compile-file "...breaktest.lisp")) the debugger is not so confused.
The warning comes from swank-sbcl.lisp because the sb-di::code-location-toplevel-form-offset always returns 0 which seems like a SBCL bug.
Helmut
On 1 September 2010 17:59, Helmut Eller heller@common-lisp.net wrote:
CL-USER> (load "/home/ryan/breaktest.lisp")
When loading the fasl file (load (compile-file "...breaktest.lisp")) the debugger is not so confused.
The warning comes from swank-sbcl.lisp because the sb-di::code-location-toplevel-form-offset always returns 0 which seems like a SBCL bug.
Well, let's say a missing feature: source locations are currently not available for code loaded as source.
Cheers,
-- Nikodemus