[Top][All Lists]

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

Re: PLEASE: debugging embedded guile code

From: Joris van der Hoeven
Subject: Re: PLEASE: debugging embedded guile code
Date: Sun, 27 Apr 2003 10:40:58 +0200 (CEST)

> >>>>> "Joris" == Joris van der Hoeven <address@hidden> writes:
>     Joris> On 26 Apr 2003, Neil Jerram wrote:
>     >> I agree, but I also think that the lazy-catch mechanism is more tricky
>     >> than it needs to be, especially in C.  So I'd like to get the
>     >> mechanism right first and then document it.
>     Joris> We now started to use lazy-catch more and more, but we might
>     Joris> still change that. Can you tell us what you have in mind?
> Don't panic; I have nothing in mind yet.  Judging from the apparent
> difficulty that people have with this area on the mailing list, I
> thought this was an issue that we should think about.  If it really
> isn't an issue, no problem (except that we should improve the docs).
> lazy-catch in Scheme is straightforward, but my intuition is that
> doing a lazy-catch in C is harder work than should be needed to obtain
> error information.  My problem is that I don't understand why you'd
> ever do it in C instead of Scheme, yet there have been several posts
> describing how to do exactly that.  Hence my question about why one
> needs to do this in C (which I don't think anyone has answered yet).

I personally do not really need to make the distinction between
Scheme-level and C-level (C++-level for me) anymore, because I added
a C++ class 'object' which allows me to directly manipulate scheme
objects at C++-level. In particular, if you implement the routines
error->... below at Scheme-level, then we may take advantage of
them at C++-level too.

>     Joris> I also think that there you might add some scheme routines
>     Joris> to construct comprehensive error messages from error
>     Joris> objects.  This would allow me to print these messages in a
>     Joris> popup window or include them in a status buffer. I
>     Joris> currently print everything to standard output or error...
>     >>
>     >> I think I understand, but can you give an example?
>     Joris> You might for instance provide routines
>     Joris>    (error->message error-obj)
>     Joris>    (error->backtrace error-obj)
>     Joris>    (error->source error-obj)
>     Joris>    (error->file-name error-obj)
>     Joris>    (error->line-number error-obj)
>     Joris>    etc.
> Right.  With the current organization of things, the location of an
> error is described by a stack obejct, so I think all of these but the
> first would be stack->X rather than error->X, but I see what you mean.
> These raise another C vs. Scheme question, though.  These routines are
> trivial to implement in Scheme, but wouldn't then be readily available
> on the C level.  Does that matter? and if so, why?

reply via email to

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