unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Evaluating (exit) in the debugger
@ 2008-11-20  0:53 Derek Peschel
  2008-11-21  0:09 ` Neil Jerram
  0 siblings, 1 reply; 6+ messages in thread
From: Derek Peschel @ 2008-11-20  0:53 UTC (permalink / raw)
  To: guile-devel

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

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

Thanks,

-- Derek




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-11-23 22:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-20  0:53 Evaluating (exit) in the debugger Derek Peschel
2008-11-21  0:09 ` Neil Jerram
2008-11-21  0:48   ` Derek Peschel
2008-11-21  9:58     ` Derek Peschel
2008-11-21 21:14       ` Derek Peschel
2008-11-23 22:24     ` Neil Jerram

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).