From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Meehan Newsgroups: gmane.lisp.guile.user Subject: Re: Python's pdb module Date: Fri, 30 Apr 2021 22:00:16 -0500 Message-ID: References: <7d007d00-23a7-c10f-c888-b4b07ea67ce6@gmail.com> Mime-Version: 1.0 (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="30024"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat May 01 05:00:54 2021 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 1lcfsE-0007i2-45 for guile-user@m.gmane-mx.org; Sat, 01 May 2021 05:00:54 +0200 Original-Received: from localhost ([::1]:33890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcfsC-0005EI-TI for guile-user@m.gmane-mx.org; Fri, 30 Apr 2021 23:00:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcfrm-0005Dw-M9 for guile-user@gnu.org; Fri, 30 Apr 2021 23:00:26 -0400 Original-Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]:35829) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcfrg-0003aQ-O5 for guile-user@gnu.org; Fri, 30 Apr 2021 23:00:22 -0400 Original-Received: by mail-qv1-xf36.google.com with SMTP id x27so58625qvd.2 for ; Fri, 30 Apr 2021 20:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to; bh=RB86rwNcD4xwWTSA7GGgXumgGXrZytUow/PbyFIfS6M=; b=D07JP0oSV1L3YnMMnwSQdcnvLUN9pScDUYE4U1ak84qlFIFHp63fx1XtfQiTDI90Ox Qz8kmdkpwGN61wtl2NgCbr+/SCEoNTCb2Ju+xu7CQrT4x5yGuybG8KHkYm3EvMbFVpSv /lPabf1eiJncXy+x5scf5TTYN+Ug8fd9QzWzlzupAV6AXdXdlS0oeCRh6YR3rDvyWVvZ SJwE9dgJvIJM4dlwkgo453Nwtqd8ynw7Lpary8LP01Ff6Bt13VlE5uAsvVXaJFG4C9YL eLiEVcWGz6V+l+N0L1viff69LaIJIctrWSzd6FqXVdXCpiCTtAxFIVJ8EebuCkZ5AEeT AXJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to; bh=RB86rwNcD4xwWTSA7GGgXumgGXrZytUow/PbyFIfS6M=; b=MyTTCtjJrMdUsNP69Yie9rB91AI940WVnDcaUyXuNn8ouIJ4zngaggZq4KUSZ5Tn0g TfBWiH95R6nrI07qi8c71wzfmmLbtn8sVLEYLWHDkB4YcFAXjj9tZt7RfnMSzN4ISpiQ 7dD4TkvgNf6eVs0v2dwoTQmM0c/HWKfRMlHcTDDL2YphdKSvXq212mxWTevBGDzNy2Y8 Eu8icKqjuv5isnWWm72PXyTtuVjoAxDfWmyU9KGtXjpUfLnNLFGxmUNqA8f/EZJhuX+x QnIK3hs2oTdRZOTJ1+89WB+w8RumR/49OOmpMvIjlBHeHly96STfEmZ0sztiuv4qCaKZ l+uA== X-Gm-Message-State: AOAM533kNev32WDBeKrURwSNRP7n1FAStAZhB8rKo2rKjoayxbPqur3i w9W/OrorXD4jonbIYX+yA6gzCXs1EMg= X-Google-Smtp-Source: ABdhPJx2CIu6INBFO8UEh1BecJtsAzLSUsCJxXW+aIpkWW4vRM+YCtfVPpOlmyuf/hcGpAAD/7Wzxw== X-Received: by 2002:a0c:9ad7:: with SMTP id k23mr8673367qvf.24.1619838019061; Fri, 30 Apr 2021 20:00:19 -0700 (PDT) Original-Received: from ?IPv6:2600:1005:b04c:3541:c495:5704:b654:ba9d? ([2600:1005:b04c:3541:c495:5704:b654:ba9d]) by smtp.gmail.com with ESMTPSA id o12sm1080528qkk.11.2021.04.30.20.00.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Apr 2021 20:00:18 -0700 (PDT) In-Reply-To: <7d007d00-23a7-c10f-c888-b4b07ea67ce6@gmail.com> X-Mailer: iPhone Mail (18D70) Received-SPF: pass client-ip=2607:f8b0:4864:20::f36; envelope-from=btmeehan@gmail.com; helo=mail-qv1-xf36.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_FROM=0.001, MISSING_HEADERS=1.021, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:17492 Archived-At: Thanks for the ideas folks! > On Apr 30, 2021, at 08:24, Matt Wette wrote: >=20 > =EF=BB=BF >> On 4/29/21 8:26 PM, Tim Meehan wrote: >> Is there something in Guile that is similar to Python's "pdb" module? >> For instance, sometimes I find it helpful to pause right before something= >> bad happens with: >>=20 >> #!/usr/bin/env python3 >> import pdb; pdb.set_trace() >> some_function_that_is_going_to_fail_miserably() >=20 > I started on something years ago but never got it working as nice as pytho= n, > as the guile debugger still needs some help to get there. Try this snipp= et. >=20 > (define-syntax-rule (jump-to-debugger) > (if (eqv? 'regular (vm-engine)) > (give-warning) > (start-repl > #:debug (make-debug (stack->vector (make-stack #t)) 0 "trap!" #t)))= ) >=20 > You'll need some of this mess to resolve procedures: >=20 > (use-modules (system repl repl)) > (use-modules (system repl debug)) > (use-modules (system repl common)) > (use-modules (system repl command)) > (use-modules (system vm frame)) > (use-modules (system vm vm)) > (use-modules (ice-9 control)) > (use-modules (ice-9 rdelim)) > (use-modules (ice-9 pretty-print)) > (use-modules (system base compile)) >=20 > Matt >=20 >=20