From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Taylan Ulrich Bayirli/Kammer Newsgroups: gmane.lisp.guile.user Subject: Re: Entering the interactive debugger Date: Tue, 02 Sep 2014 22:14:17 +0200 Message-ID: <877g1lhjae.fsf@taylan.uni.cx> References: <82egvtdeul.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1409688878 21304 80.91.229.3 (2 Sep 2014 20:14:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Sep 2014 20:14:38 +0000 (UTC) Cc: Carlos Pita , Guile User To: "Thompson\, David" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Sep 02 22:14:31 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XOuTH-0000pI-3k for guile-user@m.gmane.org; Tue, 02 Sep 2014 22:14:31 +0200 Original-Received: from localhost ([::1]:40058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOuTG-0003qA-Li for guile-user@m.gmane.org; Tue, 02 Sep 2014 16:14:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOuT7-0003pY-Lu for guile-user@gnu.org; Tue, 02 Sep 2014 16:14:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOuT6-0001Fx-FB for guile-user@gnu.org; Tue, 02 Sep 2014 16:14:21 -0400 Original-Received: from mail-la0-x234.google.com ([2a00:1450:4010:c03::234]:60870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOuT6-0001F3-89 for guile-user@gnu.org; Tue, 02 Sep 2014 16:14:20 -0400 Original-Received: by mail-la0-f52.google.com with SMTP id ty20so8473692lab.39 for ; Tue, 02 Sep 2014 13:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=j1kfmi8CbwbqtsosCvHS5AIhBaW0ok8RzCv6bm4mB9g=; b=mnXIfL3IaH99cNUNsGJ1P7rAaFvY0MY9GsO4AL/UfNd0qm2adPMHJTio+jEwgv7n0e uodTmxaK7q4hyc+gwqQ2acnrRAP4M+HjqOZBVt/8qHYhyItudQFmaqv/MYGYWw62uOxS BVWPdE7r1cNSElCfg3aNcHHhSncLnRmOzEblVvPRO5EvntSw2/EUOaaOX2dwFucAGJmn Gy22kqXK8EeYgjxdfGlUGWB2wabAB0i3uL3u6pbuELxDhPNzG6tUoGnVXXdEV0595Irg EZmk+b37sTO1djUnpTskx8QQWtoMI6z3ZXIXUYdjHwd2y1kHa2EnTsW/7qL8mv6x4kM4 NyBA== X-Received: by 10.152.36.4 with SMTP id m4mr23010074laj.17.1409688859164; Tue, 02 Sep 2014 13:14:19 -0700 (PDT) Original-Received: from taylan.uni.cx (p200300514A1DE4920213E8FFFEED36FB.dip0.t-ipconnect.de. [2003:51:4a1d:e492:213:e8ff:feed:36fb]) by mx.google.com with ESMTPSA id tc8sm6667042lbb.8.2014.09.02.13.14.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Sep 2014 13:14:18 -0700 (PDT) In-Reply-To: (David Thompson's message of "Tue, 2 Sep 2014 15:20:12 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::234 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 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-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11446 Archived-At: "Thompson, David" writes: > On Tue, Sep 2, 2014 at 3:03 PM, Carlos Pita wrote: >> Hi all, although I have some experience with lisps, I'm still new to >> guile and I'm having some trouble figuring out how to invoke the >> interactive debugger at some arbitrary point in my code. Something like: >> >> ; code here >> (debug) >> ; more code here >> >> The closer solution I could find in the manual is: >> >> add-trap-at-source-location! file user-line >> >> Any suggestion? > > I don't know of any straightforward solution, but I would also like > such a feature. I don't think it would be too difficult to write a > 'debug' procedure using the 'debug-trap-handler' procedure in (system > repl error-handling) as inspiration. Basically, you'd need to capture > the current stack and spawn a new REPL in debug mode that uses that > stack. Couldn't you just use (error)? It will enter the debugger if run from the REPL or otherwise when debugging is enabled on the VM or so (I don't know the details), though it will abort if run stand-alone; not sure if that's enough for your purposes. Taylan