From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Fredrik Salomonsson Newsgroups: gmane.lisp.guile.user Subject: How do people debug their guile code? Date: Tue, 08 Sep 2020 10:42:37 -0700 Message-ID: <877dt4kvw2.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18102"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Sep 08 19:43:30 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFheU-0004ca-Kq for guile-user@m.gmane-mx.org; Tue, 08 Sep 2020 19:43:30 +0200 Original-Received: from localhost ([::1]:45832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFheT-000494-Ml for guile-user@m.gmane-mx.org; Tue, 08 Sep 2020 13:43:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFhdm-0003Yk-7n for guile-user@gnu.org; Tue, 08 Sep 2020 13:42:46 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:57557) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFhdj-0001vV-JG for guile-user@gnu.org; Tue, 08 Sep 2020 13:42:45 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id E7FDC2400FB for ; Tue, 8 Sep 2020 19:42:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1599586960; bh=9GF++isjS6AFyZMLsT8jZ0lXUEnejJpM2SUtYT+Wapk=; h=From:To:Subject:Date:From; b=dAG2smzBIO4EvSVuxVq3OHerpU3ZDteDsl0uCWzt7pHHyA6g9q6wCHCPonveR5+qz +767QW8lGBdAOALZkmrLm8SwSD60ET1AdOJawQUKtufMr4o8rJuUdjK6AOXiH00BnJ tPcaf6RUGc4mo8m/VmDXc6pudSSN44OWa923EtzGdtN4aYnX8dJ6SNNVoWZs7IFpfB p52EDZDZQc2ZQOV/AVBrprD9it4m8v4K413FCUhSJpMWgOpO0bHbVoaIuB5+wS6lvs UIxjMZl8fuXTCMdCmLrElq7oRxaK5eHoNnEEfVZ1lZYBSWXyLORyMVDtEfsWBvo6ga ynu470KyLAPJA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4BmCCh1HDmz9rxB for ; Tue, 8 Sep 2020 19:42:39 +0200 (CEST) Received-SPF: pass client-ip=185.67.36.66; envelope-from=plattfot@posteo.net; helo=mout02.posteo.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/08 13:07:31 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16892 Archived-At: Hi again, I recently asked about something similar but more Emacs specific in the thread "Debug=C2=A0setup=C2=A0in=C2=A0Emacs". But it seems there are some m= ore work to be done to get it properly hooked up with Emacs' GUD. I asked a follow up question how people debug their code and got as suggestion that it might be better to create a separate thread for it. So here it is. I'm fairly new with guile (hence why I ask about this). My workflow (in other languages) is usually to write tests, then when something goes wrong I hook up a debugger and step through the code. For guile I've been just writing tests and when something goes wrong I sprinkle (format=C2=A0#t=C2=A0...) and re-run the tests. I haven't dabbled = that much in running the REPL as I haven't figured out a good way of setting up the same environment as when I run the tests (using guile-hall). What I gathered from the "Debug=C2=A0setup=C2=A0in=C2=A0Emacs" thread. Is t= o sprinkle print out statements using the "format" or "simple-format" procedure. Use the "pk" procedure. Use the REPL if the setup is easy enough, combined with the use of trace. And to write tests. So I'm curious if there are other workflows/steps people use/take? Thanks --=20 s/Fred[re]+i[ck]+/Fredrik/g