[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: Fri, 21 Nov 2008 01:58:52 -0800
User-agent: Mutt/

On Thu, Nov 20, 2008 at 04:48:32PM -0800, Derek Peschel wrote:
> On Fri, Nov 21, 2008 at 12:09:18AM +0000, Neil Jerram wrote:

> > 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?

> 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.

You're right, eval-handler does throw 'continue as it exits.  I hadn't
taken that complication into account, or defined the problem totally clearly.
Well, I did already know that the problem is not the rethrow behavior per
se.  The problem is how to invisibly get the quit exception to a handler
that can deal with it by quitting, while allowing the debugger to catch
every other exception that can possibly be thrown by the debuggee and
ideally to give a backtrace.

Before eval-handler throws 'continue, it uses key and args to print the
backtrace.  I did two tests to demonstrate the backtrace-printing part of
eval-handler.  In test 1, I put in (display)s of key and args.  That's how
I know eval-handler gets an "unhandled quit exception" exception.

In test 2, I also added a (lazy-catch 'quit) inside the (lazy-catch #t) in
(evaluate), really just to see what would happen.  And that inner handler
gets a regular quit exception.  Then it rethrows it, because I couldn't
think of anything better to do.  And eval-handler gets the same exception
as in test 1.

I can send patches or terminal transcripts for both tests.

Clearly I'll next have to see what eval-handler can do besides throwing
'continue.  But even before that throw happens, things are uglier than I
wanted because eval-handler doesn't get a quit exception.  My solution of
special-casing the "unhandled quit exception" exception might work, it's
just not elegant.

I also have to figure out why eval-handler is not getting an ordinary quit
exception in test 1.

-- Derek

reply via email to

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