[Top][All Lists]

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

Evaluating (exit) in the debugger

From: Derek Peschel
Subject: Evaluating (exit) in the debugger
Date: Wed, 19 Nov 2008 16:53:43 -0800
User-agent: Mutt/

Hi a second time.  

I'm using Guile 1.8.4, a copy of (ice-9 debugging) from guile 1.8.5, and
guile-debugging 0.15.  It seems natural to type "e (exit)" at the debug>
prompt.  Unfortunately the quit exception isn't acted on.  Is there any
reasonable way to change the debugger?  Note the following:      

- The debugger must catch all exceptions created by evaluated code,
  not just a list of certain kinds, so it can isolate itself from the
  effects of the code.

- The debugger must use lazy-catch so it can save and show the details
  of the error.

- With regular catch, you can do:

    (catch #t
           ;; thunk which returns #f

           ;; handler which checks the exception type
           ;;   if 'quit, set status (known to the caller of the catch)
           ;;     and return #t
           ;;   otherwise, do the right nonlocal thing

  and the caller of the catch can look at the Boolean and status.  The code
  in (ice-9 boot-9) does exactly this.  But that won't work with lazy-catch;
  if the handler returns the exception is rethrown.

- I'm not aware of any syntax for catching all exceptions excluding a
  list of types.  If that syntax existed, I could avoid invoking the lazy-
  catch handler.

The more _un_reasonable solutions I've thought of:

- Passing a continuation (which exits when invoked) to the handler.  The
  documentation hints that handlers may invoke any continuation they can

- Special-case code that lets the rethrow or series of rethrows happen,
  avoids printing any error messages, and eventually exits.  The original
  quit exception quickly becomes an "unhandled quit exception" exception
  so the code must deal with that too.

Writing a debugger command that calls (exit) was much easier.  But that
won't solve this problem AFAIK.


-- Derek

reply via email to

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