[Top][All Lists]

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

Re: Evaluating (exit) in the debugger

From: Derek Peschel
Subject: Re: Evaluating (exit) in the debugger
Date: Thu, 20 Nov 2008 16:48:32 -0800
User-agent: Mutt/

On Fri, Nov 21, 2008 at 12:09:18AM +0000, Neil Jerram wrote:
> I'm afraid I don't understand.  What do you want to happen when you
> type "e (exit)"?

I want Guile to exit, just as normally happens when you call (exit).
Also return codes should be supported in the debugger as in the REPL,
e.g. "e (exit 5)" should return 5 to the calling UNIX process.

The principle is that the debugger should not interfere with the
actions of code it's debugging, which to me includes "e"'d code.

> Agree that it does at the moment, but I'm not sure this is strictly
> needed.  The debugger "e" command is mostly intended for variable
> values and simple expressions - so normally there could not be a
> backtrace of much interest.

Obviously I'm abusing it then. :)  Seriously, if you did evaluate a
complex expression, or were confused about environment lookup (since the
expression is evaluated in the context of the current stack frame as
chosen by the up/down/frame commands, right?) the backtrace would be

This gets into issues like recursive debugging, which is a feature I
confess I haven't used much yet, however nice it may be in theory.

> The lazy-catch handler can also set a variable (global or lexical), can't it?

It certainly should be able to.  That might lead to a workable solution.
Suppressing error messages is another necessary part of the solution
(at least IMO).

> Just had a quick look at eval-handler in (ice-9 debugger commands)...
> did you notice that it ends with (throw 'continue) - and hence that
> the default lazy-catch rethrowing isn't actually happening?  Is it
> possible that (throw 'continue) is the cause of the problem?

I will have to look at the code and my experiments later, when I've
finished the things I'm supposed to be doing.  However I know for a fact
that at least one level of handler gets the "unhandled quit exception"
I described, with nothing related to continue that I've seen.

And I need to work out how many levels of handler are running when the
evaluation happens.  I wonder if Guile can tell me that?

-- Derek

reply via email to

[Prev in Thread] Current Thread [Next in Thread]