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:39:14 -0800 Message-ID: <1571373554.24401.4.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="253585"; 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:40:04 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 1iLK3T-0013kE-9b for guile-user@m.gmane.org; Fri, 18 Oct 2019 06:39:59 +0200 Original-Received: from localhost ([::1]:35270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLK3S-0005T4-4Q for guile-user@m.gmane.org; Fri, 18 Oct 2019 00:39:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44528) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLK2t-0005Si-2D for guile-user@gnu.org; Fri, 18 Oct 2019 00:39:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLK2r-00043O-IG for guile-user@gnu.org; Fri, 18 Oct 2019 00:39:22 -0400 Original-Received: from mx.kolabnow.com ([95.128.36.40]:25172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iLK2r-00042y-8e for guile-user@gnu.org; Fri, 18 Oct 2019 00:39:21 -0400 Original-Received: from localhost (unknown [127.0.0.1]) by ext-mx-out003.mykolab.com (Postfix) with ESMTP id B1C0540D4E for ; Fri, 18 Oct 2019 06:39:19 +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=1571373559; x=1573187960; bh=/qcFW+CNdbqslAEpDbo zVb4r362HBzD76Pn3ySOUETs=; b=LfVjjAboNWeMaXLqvh7IuXL8UPQumKYSTYY /YbCdeF5XkBhGy9tRbBKfwx+kLbseKoSAY3fQ2Wl6rm5KfBHmwnTF/iLH6/0BLOH VK44H0oO4O+nMQZ8nSqC4KgjhvFMHBlUeAy6e4FQDgKqQ7mKJNRfic7xwBy1eqk9 oNfcMS86qvoNacCxIu1sriN0o56/JqCFGJaFwPl0PCKt5xLDJhsDRVJAX/pFlNq1 7k00PqPP3EAHw2eRU3bg4NonH8Y4sVaIRZuf05XYe0+3a48t1Yy78iZRAAKd1A+r oRrUvmgnn3zPQ+qRyyAk+CqKpPCkLleI96wkZpzSMSeBnLM+31eIQ+wWEfVhO0pG pZMK3tb6A/jw3BCZ+N4ub5qo3FhLEKb9rbBqeEkkdzsBk5lKbbkxn5GcZ6gL+KzW xwt57QkMeb4z/nh0WF5mAMVobWiLNoZFk3QUbZ0lQprg3eXGa+7tQfm0B1Wy/Nng +SZ//qGNMWHTwNhIH/l2S1M6vIBXJlMjiOy0UzIFxPnAvRuSLkgoJESOYUF+2FV+ GiGF9KOItQf32qtwX1lznuU+dVA5Pv5YHgOPFrGB3QDSX7 X-Virus-Scanned: amavisd-new at mykolab.com Original-Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bDHycFervsyu for ; Fri, 18 Oct 2019 06:39:19 +0200 (CEST) Original-Received: from int-mx003.mykolab.com (unknown [10.9.13.3]) by ext-mx-out003.mykolab.com (Postfix) with ESMTPS id 0043540C66 for ; Fri, 18 Oct 2019 06:39:18 +0200 (CEST) Original-Received: from ext-subm003.mykolab.com (unknown [10.9.6.3]) by int-mx003.mykolab.com (Postfix) with ESMTPS id A2DEAA92 for ; Fri, 18 Oct 2019 06:39:18 +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.40 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:15755 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