guile-devel
[Top][All Lists]
Advanced

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

Re: PLEASE: debugging embedded guile code


From: Neil Jerram
Subject: Re: PLEASE: debugging embedded guile code
Date: 26 Apr 2003 20:30:50 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

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

    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?

Regards,
        Neil





reply via email to

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