unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Derek Peschel <dpeschel@eskimo.com>
To: guile-devel@gnu.org
Subject: Evaluating (exit) in the debugger
Date: Wed, 19 Nov 2008 16:53:43 -0800	[thread overview]
Message-ID: <20081119165343.A29659@eskimo.com> (raw)

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




             reply	other threads:[~2008-11-20  0:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-20  0:53 Derek Peschel [this message]
2008-11-21  0:09 ` Evaluating (exit) in the debugger 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081119165343.A29659@eskimo.com \
    --to=dpeschel@eskimo.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).