Page 1 of 1

Debugger display mistake

Posted: Thu Nov 03, 2005 9:59 pm
by Dmi
Lutz!
I found following in the debugger:
I have a function with two identical function calls. In the example theese are '(+ a b). When debugger wants to point to the second fun call, it always point to the first instead. The part of debugging session below shows that:

Code: Select all

(define (testdbg a b)
  (let (c (+ a b)) 
   (println c) 
   #(println (+ a b))#))


[-> 3 ] s|tep n|ext c|ont q|uit > s

-----

(define (testdbg a b)
  (let (c #(+ a b)#) 
   (println c) 
   (println (+ a b))))
I have also a feature request:
When error/exception occured and it's unhandled, is there a way to get debugger prompt without stack reset? - so we'll be able to interactive examine variables, which values cause an error.

Posted: Sat Nov 05, 2005 12:43 am
by Lutz
(1) This is documented in the reference for 'trace', which is a shortcult for 'debug'. Avoiding this is very expensive to code, so I opted not changing this.

(2) You can interactively examine variables by just entering the symbols or expressions at the debug prompt.

Lutz

ps: how many people use 'debug/trace' on a regular basis? instead of lots of good old 'println' ;)

Posted: Sat Nov 05, 2005 4:25 am
by nigelbrown
Lutz wrote: ps: how many people use 'debug/trace' on a regular basis? instead of lots of good old 'println' ;)
I couldn't claim regular use but it has got me out of a hole from time to time - it shows how you got there as well as where you are.
I should probably use it more.

Nigel

Posted: Sat Nov 05, 2005 8:45 am
by pjot
I never used it. Most of my problems come from the fact that I forget some bracket somewhere, I created a small script to point out where the brackets are missing. With logical errors I use the good old "println".

Peter

Posted: Sat Nov 05, 2005 9:15 am
by PaipoJim
I'm a println man myself from way back but I used the debugger today. I was about eight levels deep in a sea of parentheses, they were balanced (though not very well as it turned out), and I couldn't figure why I was getting different runtime errors as I switched things around, until I started watching the little pound signs lining up during the trace as I stepped through the evaluations.

Which reminds me to ask: It would be nice to have readline support *inside* the debugger.

Posted: Sat Nov 05, 2005 4:39 pm
by Dmi
I'm mostly a sysadmin now, so I prefer speedy scripting, oriented on results and possibilities - not on programming itself. Also often I'm interesting on uneven cases traking etc. So I'm really glad with an interactive console and found a debugger very useful.

About inspecting variables: I know that it works in debugger, but if I'm not already in trace mode, in case of unattended error, the operation stack resets and I lost all values, defined with 'let', 'dolist' etc.

Is it possible to have a mode when debugger (or error-event - like function or symply a pure console) will be invoked automatically without stack reset?
(the abiliti of latter continuation from function, next to error point will be exellent ;)

Posted: Sun Nov 06, 2005 1:50 am
by Lutz
That may be possible, I will look into it,

Lutz

Posted: Sun Nov 06, 2005 7:52 pm
by Dmi
Thanks