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: Re: guile-debugging: how to access source properties from trap context Date: Sat, 7 Jan 2006 17:54:38 +0100 Message-ID: <20060107165438.GA23651@tosh> References: <20060101213351.GA5366@tosh> <87vex3pjni.fsf@ossau.uklinux.net> <87hd8mpzvo.fsf@ossau.uklinux.net> <20060102223316.GA4905@tosh> <871wzoj4wn.fsf@ossau.uklinux.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1808502209==" X-Trace: sea.gmane.org 1136652942 3915 80.91.229.2 (7 Jan 2006 16:55:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 7 Jan 2006 16:55:42 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jan 07 17:55:38 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 1EvHLk-0001Kx-3h for guile-user@m.gmane.org; Sat, 07 Jan 2006 17:55:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EvHNZ-0001Mv-Oy for guile-user@m.gmane.org; Sat, 07 Jan 2006 11:57:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EvHNM-0001Mn-RB for guile-user@gnu.org; Sat, 07 Jan 2006 11:57:09 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EvHNK-0001Mb-1g for guile-user@gnu.org; Sat, 07 Jan 2006 11:57:08 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EvHNJ-0001MY-ER for guile-user@gnu.org; Sat, 07 Jan 2006 11:57:05 -0500 Original-Received: from [212.42.230.39] (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 1EvHPG-0002S1-E2 for guile-user@gnu.org; Sat, 07 Jan 2006 11:59:06 -0500 Original-Received: by pomo.hostsharing.net (Postfix, from userid 68507) id C4379A03EBB; Sat, 7 Jan 2006 17:55:14 +0100 (CET) Original-Received: by frechet; Sat, 07 Jan 2006 17:54:38 +0100 Original-To: Neil Jerram In-Reply-To: <871wzoj4wn.fsf@ossau.uklinux.net> 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:5043 Archived-At: --===============1808502209== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4Ckj6UjgE2iN1+kY" Content-Disposition: inline --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Neil, On 01-03, Neil Jerram wrote: > Holger Blasum writes: > Perhaps it would make sense for the debugger to show the source > position automatically on each step? What do you think? At least gdb, pydb (python) and ocamldebug (ocd) do this. But any verbosity trade-offs are better left to your consideration ... For reference here are the current ocamldebug and pydb default styles: (ocd) s Time : 2 - pc : 4164 - module Pervasives 112 float_of_bits 0x7F_F0_00_00_00_00_00_00L<|a|> (pydb) step ?() at server.py:1 1 from SocketServer import StreamRequestHandler, ThreadingTCPServer > So are you really looking for a _non_-interactive solution then? > In that case I recommend the trace-trap and trace-until-exit > behaviours provided by (ossau trace), and `set-trace-layout' to > configure exactly what trace output you want at each trap point. Wonderful, works great ;)=20 > Thanks. Can you suggest some wording that would make it clear that > these are not the _only_ available procedures for getting information > out of a trap context? (Perhaps something including a reference back > to 2.4.2?) Perhaps:=20 "In addition to the trap low-level context functions given in section 2.4.2= ,=20 high-level trap context access is offered by the trap context object. It is an object that ..."=20 Perhaps merge 2.4.1 with 2.4.3 and 2.4.2 with 2.4.4?=20 > What about instead adding a whole new "Examples" chapter before the > current "Traps" one, containing the examples that we've discussed in > this thread, and other useful ones as they arise in future? I think > that would be easier for a reader to find than an example buried > inside 2.10, and would allow 2.10 and its neighbours to keep their > existing more reference-style flavour. Yes! For more feedback, I've also been asked whether instead of=20 the number of applications I could give the number of time. (Like=20 in petite scheme "(time (some-evaluation))"). > Also, I'm still not quite clear what you mean by profiling. Which of > the examples that we've discussed best fits what you have in mind? The trace-trap example you gave last might fit closest.=20 Just as a last addendum, I've run into a garbage-collection segfault=20 with the combination minlog 4.0/guile-core.unstable-20060105/ guile-debugging-0.12/i686 GNU/Linux 2.6.14 #4. (gdb) file /usr/local/bin/guile (gdb) run guile> (use-modules (ossau breakpoints) (ossau trace)) guile> (debug-set! stack 0) guile> (debug-set! depth 0) guile> (debug-set! maxdepth 0) guile> (debug-set! indent 0) guile> (debug-set! width 0) guile> (set-trace-layout "~20@a: ~a\n" trace/source trace/info) guile> (break-in 'set-goal #:behaviour (list trace-trap trace-until-exit)) guile> (load "examples/analysis/extraction.scm.guile") Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1211029280 (LWP 24947)] 0xb7f424d5 in scm_gc_mark (ptr=3D0xb6fb8490) at gc-mark.c:160 160 { 0xb7f36538 in scm_gc_mark (ptr=3DVariable "ptr" is not available. ) at gc-mark.c:168 168 scm_gc_mark_dependencies (ptr); #0 0xb7f36538 in scm_gc_mark (ptr=3DVariable "ptr" is not available. ) at gc-mark.c:168 #1 0xb7f363e9 in scm_gc_mark_dependencies (p=3D0xb6085db0) at gc-mark.c:270 #2 0xb7f3653d in scm_gc_mark (ptr=3DVariable "ptr" is not available. ) at gc-mark.c:168 =2E.. Remarkably, one then can segfault gdb too by asking it via "bc -10"=20 to spit out the ten outer 10 stack frames. #149734 0xb7f70a19 in scm_shell (argc=3D1, argv=3D0xbfbd7cd4) at script.c:737 #149735 0xb7f51515 in invoke_main_func (body_data=3D0xbfbd7c04) at init.c:367 #149736 0xb7f25040 in c_body (d=3D0xbfbd7b78) at continuations.c:359 #149737 0xb7f91106 in scm_internal_catch (tag=3D0x104, body=3D0xb7f25030 , body_data=3D0xbfbd7b78, handler=3D0xb7f25050 , handler_data=3D0xbfbd7b78) at throw.c:173 #149738 0xb7f2500d in scm_i_with_continuation_barrier ( body=3D0xb7f25030 , body_data=3D0xbfbd7b78, handler=3D0xb7f25050 , handler_data=3D0xbfbd7b78) at continuations.c:336 Program received signal SIGSEGV, Segmentation fault. 0x08152319 in dwarf2_frame_cache (next_frame=3D0xfcf0698, this_cache=3D0xfcf0ae8) at dwarf2-frame.c:637 (Info of last line of course comes from running "minlog from guile =66rom gdb from gdb".) I then tried to find an easier test case to reproduce this (without the theorem prover context), but (define (rec n) (case n ((1) 1)=20 (else (rec (- n 1))))) does *not* break guile even on things=20 like (rec 1000000) where presumably a million of frames is=20 on the stack(?, if not how does one turn off tail recursion optimizations= =20 and the like) ... :( Cheers, --=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 --4Ckj6UjgE2iN1+kY 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) iD8DBQFDv/JO9ydyGrpYFMERAgOmAJ9uOsVYNH9Wag2vQhx1z/JoyyV7YACbBtVT c4txvcZ2X76jm0CCkUpgDZI= =xgM+ -----END PGP SIGNATURE----- --4Ckj6UjgE2iN1+kY-- --===============1808502209== 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 --===============1808502209==--