From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Howard Newsgroups: gmane.lisp.guile.user Subject: Interactive Debugging Date: Thu, 17 Oct 2019 20:37:23 -0800 Message-ID: <1571373443.24401.2.camel@librehacker.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="247395"; mail-complaints-to="usenet@blaine.gmane.org" To: Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Oct 18 06:38:35 2019 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iLK26-0012Av-Rj for guile-user@m.gmane.org; Fri, 18 Oct 2019 06:38:35 +0200 Original-Received: from localhost ([::1]:35262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLK1y-0004q6-Gt for guile-user@m.gmane.org; Fri, 18 Oct 2019 00:38:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44209) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLK19-0004pv-Jh for guile-user@gnu.org; Fri, 18 Oct 2019 00:37:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLK18-0003V9-5m for guile-user@gnu.org; Fri, 18 Oct 2019 00:37:35 -0400 Original-Received: from mx.kolabnow.com ([95.128.36.41]:52786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iLK17-0003Ut-NQ for guile-user@gnu.org; Fri, 18 Oct 2019 00:37:34 -0400 Original-Received: from localhost (unknown [127.0.0.1]) by ext-mx-out002.mykolab.com (Postfix) with ESMTP id 49A54A36 for ; Fri, 18 Oct 2019 06:37:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= mime-version:content-type:content-type:date:date:from:from :subject:subject:message-id:received:received:received; s= dkim20160331; t=1571373449; x=1573187850; bh=jMNsLsxRioRmdkuEhVQ 82rBU/CMKLvZCD4FITngEBUc=; b=GaTuNp1t25wVLE0U/hOdv6l3CU62XLdANyG dp+BpdkmQw8IyCn/kcZsOjFYPg9uXStzzeVG29gTJ337aktrEwwdi0J932IbE0c1 ReHLh1xV4hyFKwEsao5e0WlrWqfbtfuHVPU48yy2R1+ziPJmtCc30luOC6AapLRf kVoJiBLN9JzyGOST695wxoqdXFbZBVKkEVjCkJUH5O/7BzSel5/Krv9VwFiEblvH i4VcrcRtduaYTYva4ilgZE6HP3Pwzrvespygrw/pn4Ymva9L7UY1b+mBNe1DM/XL i+NNMbvW62E4e/EJ56rAWhBzKo7/s3J8lay5ViORN+GVwoagXm5BVcLp3fYv0iuy 7WfA5zKgr4IeAtYWf+1ULZPg9pCfjDEmElVLfmB6wmGwBgZx/o2ytq0gUCNmBnpt SadxmhdlFQ4+2eKsnK/Fu6G1ZgJN/AWGFd1IRBt3x4NAWyXc8NUlEZsvlhJhI842 cXLXZ036Se3Cu2SMjcKiSvgnCS0x0wJ6/suSN85VBNxRkS2pTIzGSHloJnBKS85K r6KHDjoN+zD3XJPFxCCZenW1MiL06qodlOR7POaACEAkvU X-Virus-Scanned: amavisd-new at mykolab.com Original-Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out002.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vD9UVFNU4L3q for ; Fri, 18 Oct 2019 06:37:29 +0200 (CEST) Original-Received: from int-mx002.mykolab.com (unknown [10.9.13.2]) by ext-mx-out002.mykolab.com (Postfix) with ESMTPS id 462AE3B0 for ; Fri, 18 Oct 2019 06:37:29 +0200 (CEST) Original-Received: from ext-subm003.mykolab.com (unknown [10.9.6.3]) by int-mx002.mykolab.com (Postfix) with ESMTPS id 03AE62321 for ; Fri, 18 Oct 2019 06:37:28 +0200 (CEST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 95.128.36.41 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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 Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15754 Archived-At: Hi, it seems like with the flexibility of Guile, I should be able to do something like this: ```(define (foo)=C2=A0 (let ((a 1)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0(b 2)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(c 3))=C2=A0= =C2=A0=C2=A0=C2=A0(jump-into- debugging-repl)))``` And have access to a, b, and c and their values. But I'm not quite figuring out how to this. I know from 6.26.3.2 that it possible to throw an error and capture the error stack, but I don't know how you turn that error stack into a repl, if you get what I'm trying to say. >From poking around in the source code, I found (system repl repl) and related modules. (start-repl) does throw me into a repl, but without debug information. start-repl has a #:debug key, but I can't figure out what I'm suppose to pass to it. I can do something like this, with a break: ```(define (foo)=C2=A0 (let ((a 1)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0(b 2)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(c 3))=C2=A0=C2=A0=C2=A0=C2=A0(bp)=C2=A0=C2=A0=C2=A0=C2=A0(display "done!"))= ) (define (bp)=C2=A0 '())``` But I'm not sure how to get to those locals: ```scheme@(buffer cbuff)> ,break bpTrap 1: Breakpoint at #.scheme@(guile-user)> (foo)Trap 1: Breakpoint at #Entering a new prompt.=C2=A0=C2=A0Type `,bt' for a backtrace or `,q' t= o continue.scheme@(guile-user) [1]> ,btIn current input:=C2=A0=C2=A0=C2=A0=C2= =A0700:4=C2=A0=C2=A01 (foo)=C2=A0=C2=A0=C2=A0=C2=A0703:0=C2=A0=C2=A00 (bp)scheme@(guile-user) [= 1]> ,locals=C2=A0 No local variables.scheme@(guile-user) [1]> ,upIn current input:=C2=A0=C2=A0=C2=A0= =C2=A0700:4=C2=A0=C2=A01 (foo)scheme@(guile-user) [1]> ,locals=C2=A0 No local variables.``` --=C2=A0 Christopher Howard p: +1 (907) 374-0257 w: https://librehacker.com social feed: https://gnusocial.club/librehacker xmpp: creationist@member.fsf.org otr: E9685B53 01F038DD D29281C9 30FDA71E BD0095D4 gnupg: 23FD5CC5 (keys.gnupg.net) radio: KL1TL featured: https://u.fsf.org/user-liberation