From: Neil Jerram <neil@ossau.uklinux.net>
Cc: guile-devel@gnu.org
Subject: Re: Stack unwinding for C code
Date: 27 Dec 2003 12:11:26 +0000 [thread overview]
Message-ID: <m3ad5etq8h.fsf@laruns.ossau.uklinux.net> (raw)
In-Reply-To: <87y8sz5kio.fsf@zagadka.ping.de>
>>>>> "Marius" == Marius Vollmer <mvo@zagadka.de> 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
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2003-12-27 12:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-26 21:36 Stack unwinding for C code Marius Vollmer
2003-12-27 9:53 ` tomas
2003-12-27 12:11 ` Neil Jerram [this message]
2003-12-27 17:37 ` Marius Vollmer
2003-12-28 2:25 ` Tom Lord
2003-12-29 22:12 ` Marius Vollmer
2003-12-29 23:25 ` Neil Jerram
2003-12-31 0:10 ` Marius Vollmer
2004-01-02 11:45 ` Dirk Herrmann
2004-01-02 17:38 ` Marius Vollmer
2004-01-03 22:08 ` Marius Vollmer
2004-01-10 11:45 ` Dirk Herrmann
2004-01-11 1:23 ` Marius Vollmer
2004-01-06 18:37 ` Paul Jarc
2004-01-07 20:27 ` Marius Vollmer
2004-01-13 17:24 ` Rob Browning
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=m3ad5etq8h.fsf@laruns.ossau.uklinux.net \
--to=neil@ossau.uklinux.net \
--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).