From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Bruce Korb Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: Re: PLEASE: debugging embedded guile code Date: Fri, 16 May 2003 17:31:17 -0700 Organization: Home Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <3EC582D5.6FB4D63C@veritas.com> References: <20030225093608.6a8935f8.dsmith@altustech.com> <3EAAB691.6AD935B5@veritas.com> <3EAAE877.7140ECB6@veritas.com> <3EAC5266.23DEEB7F@veritas.com> <3EAD89DB.9B0A1367@veritas.com> <87fzneoadk.fsf@raven.i.defaultvalue.org> <3EC55E9E.12D907E0@veritas.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1053131496 26357 80.91.224.249 (17 May 2003 00:31:36 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 17 May 2003 00:31:36 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat May 17 02:31:33 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19Gpbp-0006qh-00 for ; Sat, 17 May 2003 02:31:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19GpcF-0003EQ-04 for guile-user@m.gmane.org; Fri, 16 May 2003 20:31:59 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19GpVI-0008B3-00 for guile-user@gnu.org; Fri, 16 May 2003 20:24:48 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19GpUl-0007pu-00 for guile-user@gnu.org; Fri, 16 May 2003 20:24:16 -0400 Original-Received: from bay-bridge.veritas.com ([143.127.3.10] helo=mtvmime03.VERITAS.COM) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19GpTR-0007Jz-00; Fri, 16 May 2003 20:22:53 -0400 Original-Received: from megami (unverified) by mtvmime03.VERITAS.COM ; Fri, 16 May 2003 17:23:11 -0700 Original-Received: from veritas.com([172.22.12.211]) (3080 bytes) by megami via sendmail with P:esmtp/R:smart_host/T:smtp (sender: ) id for ; Fri, 16 May 2003 17:22:52 -0700 (PDT) (Smail-3.2.0.101 1997-Dec-17 #15 built 2001-Aug-30) X-Mailer: Mozilla 4.8 [en] (X11; U; Linux 2.4.19-4GB i686) X-Accept-Language: en Original-To: Rob Browning , Neil Jerram , guile-devel@gnu.org, guile-user@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: General Guile related discussions List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:1967 gmane.lisp.guile.devel:2381 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2381 OK. Some real progress. (Remember this all works when I evaluate the Guile commands using gh_eval_str): ../agen5/autogen -L ../autoopts -Taginfo -bcolumns -DLEVEL=section \ ../columns/opts.def ERROR: Unbound variable: optname-to Error in template ../autoopts/aginfo.tpl, line 154 DEFINITIONS ERROR in ../autoopts/aginfo.tpl line 154 for columns.texi: exiting Failing Guile command: = = = = = (set! opt-name (string-tr! (get "name") optname-from optname-to)) (string-append down-prog-name " " opt-name) * * * * * * * * * * * * * * * * * The issue here is that gh_eval_str processes the *entire* string and returns the result of the last expression. This "eval-client-input" function does not behave in the same way: > (define (eval-client-input str) > (stack-catch #t > (lambda () > (call-with-input-string str > (lambda (p) > (set-port-filename! p (tpl-file)) > (set-port-line! p (string->number (tpl-file-line "%2$d"))) > (list (primitive-eval (read p)))))) > (lambda (key . args) > (apply display-error > (fluid-ref the-last-stack) > (current-error-port) > args) > (set! stack-saved? #f) > #f > ) ) ) Before this failing command, the following was eval-ed at once: > (define optname-from "A-Z_^") > (define optname-to "a-z--") so "optname-from" is found, but "optname-to" is not. How do I make that ``(list (primitive-eval (read p)))'' thing into a loop that yields the last value? ALSO: notice that the Guile error message is not including the file and line numbers. Someone suggested: > (read-enable 'positions) > (debug-enable 'show-file-name) but I get errors when I do that. BY THE WAY: when I finally have this working, I'll write it up so nobody has to go through all this pain again. It's pretty awful. :( _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user