guile-devel
[Top][All Lists]
Advanced

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

Re: Stack unwinding for C code


From: Neil Jerram
Subject: Re: Stack unwinding for C code
Date: 27 Dec 2003 12:11:26 +0000
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "Marius" == Marius Vollmer <address@hidden> writes:

    Marius> The proposal below therefore addresses the registerin of cleanup
    Marius> actions, much like dynwind but in a more C friendly way.

    Marius> Comments?  (I hope to implement most of it in the next days...)

Hi Marius,

This looks nice - I'll take your word for it that we need this, and
the API looks clean as you say.  A few comments and typo corrections,
though ...

    Marius> Error reporting differes between C and Scheme: C functions usually
    Marius> return some kind of indication to their calling function when an 
error
    Marius> occured.  Scheme functions (including functions written in C that

typo - "occurred"

    Marius> These frames also inhibit continuations (as explained
    Marius> below). [...]

In API terms, this feels to me like the same area as issues like
SCM_DEFER_INTS, control of signal delivery, inhibiting thread
switching, etc.  I realize that these are quite different mechanisms
really, but it would be lovely if the API that you are proposing here
could also cope with and document all those other areas once and for
all.

    Marius>     scm_begin_frame ("foo");
    Marius>       {

Is this block necessary? - it looks a little ugly to me.

    Marius>   Starts a new frame and makes it the 'current' one.  The frame will
    Marius>   be 'non-continueable', see below.

typo - "continuable"

Also differs - perhaps confusingly - from my use of "continuable" for
a stack in (ice-9 debugger).  (My use of "continuable" is to describe
a stack at a breakpoint, where execution can continue, as opposed to
the-last-stack after an error, where execution cannot continue.

Perhaps "continuation-proof" or "continuation-protected"?

    Marius>   The given LABEL will appear in backtraces and error messages.

How (out of interest)?

    Marius>   The frame is ended either implicitely when a non-local exit 
happens,
    Marius>   or explicitely with scm_end_frame.

typos - "implicitly", "explicitly"

    Marius>   Arranges for FUNC to be called with DATA as its arguments when the
    Marius>   current frame ends implicitely.  When EXPLICITElY is non-zero, 
FUNC
    Marius>   is also called when the frame ends explicitely.

"If" sounds better than "When" here, I'd say.

    Marius> This is against the expections of most C code.  For this reason, the
    Marius> frames explained above do not allow the construction or invokation 
of

typos - "expectations", "invocation"

    Marius> - C Function: void scm_c_define_proc (const char *name,
    Marius>                                       int req, int opt, int restp,
    Marius>                                   SCM (*proc) (...))

This is not a good name: it is not helpful to suggest that "proc" =
"framed gsubr".  How about scm_c_define_framed_gsubr ?

    Marius> Also, the frames stored by the debugging evaluator could be combined
    Marius> with this.

Interesting.  Do you propose to do this as part of your initial work?

Regards,
        Neil





reply via email to

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