unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Derek Peschel <dpeschel@eskimo.com>
To: Neil Jerram <neiljerram@googlemail.com>
Cc: guile-devel@gnu.org
Subject: Re: Evaluating (exit) in the debugger
Date: Fri, 21 Nov 2008 01:58:52 -0800	[thread overview]
Message-ID: <20081121015851.A14566@eskimo.com> (raw)
In-Reply-To: <20081120164832.A7356@eskimo.com>; from dpeschel@eskimo.com on Thu, Nov 20, 2008 at 04:48:32PM -0800

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	other threads:[~2008-11-21  9:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=20081121015851.A14566@eskimo.com \
    --to=dpeschel@eskimo.com \
    --cc=guile-devel@gnu.org \
    --cc=neiljerram@googlemail.com \
    /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).