From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: Stack unwinding for C code Date: 27 Dec 2003 12:11:26 +0000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <87y8sz5kio.fsf@zagadka.ping.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1072527961 15883 80.91.224.253 (27 Dec 2003 12:26:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 27 Dec 2003 12:26:01 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Dec 27 13:25:58 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AaDW2-0003xT-00 for ; Sat, 27 Dec 2003 13:25:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AaESo-0007to-5v for guile-devel@m.gmane.org; Sat, 27 Dec 2003 08:26:42 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AaESX-0007sb-JI for guile-devel@gnu.org; Sat, 27 Dec 2003 08:26:25 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AaES1-0007gs-Hs for guile-devel@gnu.org; Sat, 27 Dec 2003 08:26:24 -0500 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AaES1-0007ec-71 for guile-devel@gnu.org; Sat, 27 Dec 2003 08:25:53 -0500 Original-Received: from [80.84.72.14] (helo=mail2.uklinux.net) by mx20.gnu.org with esmtp (Exim 4.24) id 1AaDJV-0002MA-DY for guile-devel@gnu.org; Sat, 27 Dec 2003 07:13:01 -0500 Original-Received: from localhost (s4.uklinux.net [127.0.0.1]) by mail2.uklinux.net (Postfix) with ESMTP id CBA4C409FBA; Sat, 27 Dec 2003 12:12:59 +0000 (UTC) Original-Received: from mail2.uklinux.net ([127.0.0.1]) by localhost (s4.uklinux.net [127.0.0.1:10024]) (amavisd-new) with ESMTP id 20213-10; Sat, 27 Dec 2003 12:12:27 +0000 (GMT) Original-Received: from laruns.ossau.uklinux.net (unknown [213.78.88.149]) by mail2.uklinux.net (Postfix) with ESMTP id 9BA49409FB2; Sat, 27 Dec 2003 12:12:26 +0000 (UTC) Original-Received: from laruns.ossau.uklinux.net.ossau.uklinux.net (localhost [127.0.0.1]) by laruns.ossau.uklinux.net (Postfix on SuSE Linux 7.2 (i386)) with ESMTP id 660D7DC4D4; Sat, 27 Dec 2003 12:11:26 +0000 (GMT) Original-To: Marius Vollmer In-Reply-To: <87y8sz5kio.fsf@zagadka.ping.de> Original-Lines: 80 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 X-Virus-Scanned: by amavisd-new X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3138 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3138 >>>>> "Marius" == Marius Vollmer 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