From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Holger Blasum Newsgroups: gmane.lisp.guile.user Subject: guile-debugging: how to access source properties from trap context Date: Sun, 1 Jan 2006 22:33:51 +0100 Message-ID: <20060101213351.GA5366@tosh> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1909333577==" X-Trace: sea.gmane.org 1136151256 25575 80.91.229.2 (1 Jan 2006 21:34:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 1 Jan 2006 21:34:16 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jan 01 22:34:13 2006 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EtAq9-0004Wy-Jl for guile-user@m.gmane.org; Sun, 01 Jan 2006 22:34:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EtArh-00051y-3L for guile-user@m.gmane.org; Sun, 01 Jan 2006 16:35:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EtArc-00051i-BX for guile-user@gnu.org; Sun, 01 Jan 2006 16:35:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EtArb-00051O-L7 for guile-user@gnu.org; Sun, 01 Jan 2006 16:35:40 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EtArb-00051C-H3 for guile-user@gnu.org; Sun, 01 Jan 2006 16:35:39 -0500 Original-Received: from [212.21.77.2] (helo=pomo.hostsharing.net) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EtAsX-0005XC-DT for guile-user@gnu.org; Sun, 01 Jan 2006 16:36:37 -0500 Original-Received: by pomo.hostsharing.net (Postfix, from userid 68507) id E6331A03E2E; Sun, 1 Jan 2006 22:34:04 +0100 (CET) Original-Received: by frechet; Sun, 01 Jan 2006 22:33:52 +0100 Original-To: guile-user@gnu.org User-Agent: Mutt/1.5.6+20040722i X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:5020 Archived-At: --===============1909333577== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zhXaljGHf11kAtnf" Content-Disposition: inline --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello guile-user, in the "Guile Debugging Enhancements" tutorial=20 (http://download.gna.org/guile-debugging/guile-debugging.html) there is encouragement to play with the source trap context parameters.=20 What I want to look at are the source file names and=20 line numbers like eg in any gdb stepping session of a C program say for matrix multiplication like:=20 gdb -f a.out (gdb) br main Breakpoint 1 at 0x8048417: file matrix.c, line 11. (gdb) run Starting program: /home/blasum/a/comp/sema/sample/c/samples/a.out=20 /home/blasum/a/comp/sema/sample/c/samples/matrix.c:12 (gdb) step /home/blasum/a/comp/sema/sample/c/samples/matrix.c:13 (gdb) step /home/blasum/a/comp/sema/sample/c/samples/matrix.c:14 (gdb) step =2E.. How can one access file name and line number of the source properties in guile-debugging? My first shot was at=20 $ guile guile> (use-modules (ice-9 debugger) (ossau=20 ice-9-debugger-extensions) (ossau traps) (ossau trace)) guile> (load "matrix.scm") guile> (define (report-exp trap-context) (display "Expression: ") (display (tc:expression trap-context)) (newline)) guile> (install-trap (make #:procedure mkmatrix #:behaviour (list report-exp))) guile> (do-main 4) Expression: #f Expression: #f guile> However expression (#f might be ok, because we are dealing=20 with vectors, and it *is* called twice) is the wrong=20 attribute what I'm really looking for is not the evaluated=20 expression (nor its uninterpreted source text) but its source text's file name and line number ;)=20 Any hints (even if they involve twiddling with traps.scm) very=20 welcome ... (Credits for the matrix multiplication sample=20 are to Peter Williams, matrix multiplication is not really=20 what I am interested in but is perhaps a good example for=20 testing a stepper.) Happy 2006, --=20 Holger Blasum +49-174-7313590 (gsm) GnuPG 1024D/ACDFC3B769DC1ED66B47 "It has turned out that the networking of many small computers, at many=20 places, is more efficient than the one supercomputer - the success of=20 the internet is based on this principle." - Angela Merkel, government declaration, 30 Nov 2005 --zhXaljGHf11kAtnf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFDuEq/9ydyGrpYFMERAgJJAJ9BLqdL720tlmUSAhswDGTKgzAIZACgjfqy do7h9usTS/HXN5Rl7gRPzD4= =qabd -----END PGP SIGNATURE----- --zhXaljGHf11kAtnf-- --===============1909333577== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user --===============1909333577==--