From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Viktor Pavlenko Newsgroups: gmane.lisp.guile.user Subject: Re: Debugging embeded scheme Date: Sat, 3 Apr 2004 00:08:46 -0500 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <16494.18142.53929.727200@hetman.ua> References: <20040403043128.GE4919@backlot.linas.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1080969102 30418 80.91.224.253 (3 Apr 2004 05:11:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 3 Apr 2004 05:11:42 +0000 (UTC) Cc: guile-user@gnu.org, linas@austin.ibm.com Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Apr 03 07:11:34 2004 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 1B9dRN-0007Ep-00 for ; Sat, 03 Apr 2004 07:11:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B9dR3-0008TA-Cm for guile-user@m.gmane.org; Sat, 03 Apr 2004 00:11:13 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B9dPe-0007PK-6Y for guile-user@gnu.org; Sat, 03 Apr 2004 00:09:46 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B9dOa-0006SK-TT for guile-user@gnu.org; Sat, 03 Apr 2004 00:09:14 -0500 Original-Received: from [24.156.166.210] (helo=hetman.ua) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B9dNP-0004U1-P3 for guile-user@gnu.org; Sat, 03 Apr 2004 00:07:28 -0500 Original-Received: by hetman.ua (Postfix, from userid 1000) id 1FD105C2E7; Sat, 3 Apr 2004 00:08:46 -0500 (EST) Original-To: linas@linas.org (Linas Vepstas) In-Reply-To: <20040403043128.GE4919@backlot.linas.org> X-Mailer: VM 7.17 under Emacs 21.3.1 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:3043 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:3043 >>>>> "LV" == Linas Vepstas writes: LV> Hi, LV> I'm having a miserable time figuring out how to debug embeded LV> scheme/guile. I just can't figure out how to get meaningful LV> debugging info. Let me explain what the problem is: LV> [...] LV> static SCM LV> my_catch_handler (void *data, SCM tag, SCM throw_args) LV> { LV> printf ("Error: GnoTime caught error during scheme parse\n"); LV> if (SCM_SYMBOLP(tag)) LV> { LV> char * str = SCM_SYMBOL_CHARS (tag); LV> printf ("\tScheme error was: %s\n", str); LV> } LV> scm_backtrace(); LV> return SCM_EOL; LV> } I don't know how to get backtrace but printing throw_args may help. I find using a function similar to this often during debugging: std::string obj2str( const SCM& object ) { SCM fmt = scm_makfrom0str( "~S" ); SCM s_str = scm_simple_format( SCM_BOOL_F, fmt, SCM_LIST1(object) ); return SCM_STRING_CHARS( s_str ); } -- Viktor _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user