If I have a function MAIN that looks like this:
(defun main ()
(let ((local-variable
;;;;;
;; body ))
and some bug happens while MAIN is somewhere on the stack, I can
not view LOCAL-VARIABLE from the CMUCL debugger (It's invalid)
Are there Lisps that will let me do it? Does lexical scoping have
anything to do with it?
········@ziplip.com" <·······@ziplip.com> writes:
> If I have a function MAIN that looks like this:
>
> (defun main ()
> (let ((local-variable
> ;;;;;
> ;; body ))
>
> and some bug happens while MAIN is somewhere on the stack, I can
> not view LOCAL-VARIABLE from the CMUCL debugger (It's invalid)
> Are there Lisps that will let me do it?
cmucl can do that, but you have to put
(declare (optimize (debug 3)))
before the let.
Mario S. Mommer wrote:
> ········@ziplip.com" <·······@ziplip.com> writes:
>
>>If I have a function MAIN that looks like this:
>>
>>(defun main ()
>> (let ((local-variable
>> ;;;;;
>> ;; body ))
>>
>>and some bug happens while MAIN is somewhere on the stack, I can
>>not view LOCAL-VARIABLE from the CMUCL debugger (It's invalid)
>>Are there Lisps that will let me do it?
>
>
> cmucl can do that, but you have to put
>
> (declare (optimize (debug 3)))
>
> before the let.
Isn't this the default value?
By the way is there any way to get information about the location within
the function where the error occured?
>>>>> "Rolf" == Rolf Wester <······@ilt.fraunhofer.de> writes:
Rolf> Mario S. Mommer wrote:
>> ········@ziplip.com" <·······@ziplip.com> writes:
>>
>>> If I have a function MAIN that looks like this:
>>>
>>> (defun main ()
>>> (let ((local-variable ;;;;;
>>> ;; body ))
>>>
>>> and some bug happens while MAIN is somewhere on the stack, I can
>>> not view LOCAL-VARIABLE from the CMUCL debugger (It's invalid) Are
>>> there Lisps that will let me do it?
>> cmucl can do that, but you have to put
>> (declare (optimize (debug 3)))
>> before the let.
Rolf> Isn't this the default value?
Rolf> By the way is there any way to get information about the location within
Rolf> the function where the error occured?
If you get to the debugger, then usually SOURCE will print out the
source line where the error occurred. But you probably already knew
that and were asking for something else?
Ray
Raymond Toy wrote:
>
> Rolf> By the way is there any way to get information about the location within
> Rolf> the function where the error occured?
>
> If you get to the debugger, then usually SOURCE will print out the
> source line where the error occurred. But you probably already knew
> that and were asking for something else?
>
I admit I should have known this but, I didn't (reading the manual more
carefully would have helped I guess). Thank you for your answer.
Raymond Toy <···@rtp.ericsson.se> wrote:
+---------------
| >>>>> "Rolf" == Rolf Wester <······@ilt.fraunhofer.de> writes:
| Rolf> By the way is there any way to get information about the
| Rolf> location within the function where the error occured?
|
| If you get to the debugger, then usually SOURCE will print out the
| source line where the error occurred.
+---------------
To my taste, CMUCL's VSO debugger command, generally with
an argument of 3 (or sometimes larger) tends to give a better
display, e.g.:
cmu> (defun foo ()
(let ((local-variable 17))
(break)
(1+ local-variable)))
cmu> (foo)
Break
Restarts:
0: [CONTINUE] Return from BREAK.
1: [ABORT ] Return to Top-Level.
Debug (type H for help)
(FOO)
Source: (BREAK)
0] l
LOCAL-VARIABLE = 17
0] vso 3
(LAMBDA ()
(BLOCK FOO
(LET ((LOCAL-VARIABLE 17))
(#:***HERE*** (BREAK))
(1+ LOCAL-VARIABLE))))
0] (setf local-variable 43)
43
0] continue
44
cmu>
-Rob
-----
Rob Warnock, PP-ASEL-IA <····@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607
Rolf Wester <······@ilt.fraunhofer.de> writes:
> Mario S. Mommer wrote:
> > ········@ziplip.com" <·······@ziplip.com> writes:
> >
> >>If I have a function MAIN that looks like this:
> >>
> >>(defun main ()
> >> (let ((local-variable
> >> ;;;;;
> >> ;; body ))
> >>
> >>and some bug happens while MAIN is somewhere on the stack, I can
> >>not view LOCAL-VARIABLE from the CMUCL debugger (It's invalid)
> >>Are there Lisps that will let me do it?
> >
> >
> > cmucl can do that, but you have to put
> >
> > (declare (optimize (debug 3)))
> >
> > before the let.
>
> Isn't this the default value?
Nope, by default everything is 1, except for debug, which is 2.
--
/|_ .-----------------------.
,' .\ / | No to Imperialist war |
,--' _,' | Wage class war! |
/ / `-----------------------'
( -. |
| ) |
(`-. '--.)
`. )----'
···@famine.OCF.Berkeley.EDU (Thomas F. Burdick) writes:
> Nope, by default everything is 1, except for debug, which is 2.
How can I check the current optimization levels (i.e. what was
last proclaimed) and the levels with which a specific function
was compiled?
>>>>> "kon" == Kalle Olavi Niemitalo <···@iki.fi> writes:
kon> How can I check the current optimization levels (i.e. what was
kon> last proclaimed) and the levels with which a specific function
kon> was compiled?
in CMUCL, the current optimization level is stored in the variable
C::*DEFAULT-COOKIE* (which is difficult to guess using apropos).
Information regarding the optimization level that was used when a
function was compiled isn't saved anywhere, AFAIK, though you may be
able to infer some policy settings (eg speed > safety) if you're
familiar with CMUCL by reading the function's disassembly.
It would be useful to add something like ACL's function
EXPLAIN-COMPILER-SETTINGS; this might be an interesting project for
someone looking to contribute to CMUCL, since it wouldn't require a
rebuild to implement.
[Late reply on return from vacation]
--
Eric Marsden <URL:http://www.laas.fr/~emarsden/>
Mario S. Mommer <········@yahoo.com> writes:
> ········@ziplip.com" <·······@ziplip.com> writes:
> > If I have a function MAIN that looks like this:
> >
> > (defun main ()
> > (let ((local-variable
> > ;;;;;
> > ;; body ))
> >
> > and some bug happens while MAIN is somewhere on the stack, I can
> > not view LOCAL-VARIABLE from the CMUCL debugger (It's invalid)
> > Are there Lisps that will let me do it?
>
> cmucl can do that, but you have to put
>
> (declare (optimize (debug 3)))
>
> before the let.
Or run the function uncompiled.
--
Janis Dzerins
If million people say a stupid thing, it's still a stupid thing.