From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.user Subject: Re: Python's pdb module Date: Fri, 30 Apr 2021 06:20:20 -0700 Message-ID: <7d007d00-23a7-c10f-c888-b4b07ea67ce6@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36036"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Apr 30 15:23:58 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 1lcT7c-0009Fg-VR for guile-user@m.gmane-mx.org; Fri, 30 Apr 2021 15:23:56 +0200 Original-Received: from localhost ([::1]:51556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcT7b-0000h2-MM for guile-user@m.gmane-mx.org; Fri, 30 Apr 2021 09:23:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcT4I-0005aE-3g for guile-user@gnu.org; Fri, 30 Apr 2021 09:20:31 -0400 Original-Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:33657) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcT4C-000823-KA for guile-user@gnu.org; Fri, 30 Apr 2021 09:20:29 -0400 Original-Received: by mail-pf1-x42c.google.com with SMTP id h11so8827525pfn.0 for ; Fri, 30 Apr 2021 06:20:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=rOp9dR/mufqIE2E4QOzmX/a5L6108L6KQdODYtDT6+g=; b=TtbvUvoXmtmBg8JgujcuuBRGlWlX8Yk8U7IhwvtGIUptRv8mO3IHXuwhGXi0G/eVCS +M0z+kz6L2Rc+VnlFZK3M7bZXgZrIt/9zae9yLoy2ZrKw33BAdBGBMnhLg1FqZGozQUa 2mm7HtFNoT84UIgjxjGtHXXNJ5pOaMj9J+7gptyoGhMb2OVJ+1i9vunfcQSWXiDsbCwV pMK8YfYIV2rX88j48yE+KbPRa95uafgnZNZM13YBbv5HTOVQXuZMWNlR88EaNzhP3bVX Erz5EmPwQrbOrs/87sSb17wl21XgVoOVbRiC3Qxrjdf9wmPxUZJk6q2waFe+0h29AO4J 7GXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=rOp9dR/mufqIE2E4QOzmX/a5L6108L6KQdODYtDT6+g=; b=FVzf1806PlTn7lKdF6jvSoO/O0rAoJJvvBHSnT57cvwwi2AAVGe6c16vKWSU4zHUNM ENQkcM04RnQTweorzg/OkyQNx1dfyKfs+nLFpw03usk5dcZaVGZA3Lg5JlXQMIr+ssZk +2jISZvy3o0nDUggEYrs0tXl3A15SOmZDxuYSM1eUwdk4lHz48lLGIhrbEV1IkXxvG9H F58fNGfQOnlQ4rcQr79ww+5ecB/S/wSxjQLvw77B3Xcg612V0/z16in5aP3qD1yNiCMJ JMU0KPSfTAq5eEcvYXsOi29dxkJcppfEbWw/+oIAQ2OCon6ZCcT7QvMhIabQUpqq/+H3 MLHQ== X-Gm-Message-State: AOAM532FGLNCgOBLG6de0HrLmBBFo1DGdedjpvfA5hdM/GuCU69M0Ie+ nGcG0AntGdTYAaWK8YZqgLiR2xQr14M= X-Google-Smtp-Source: ABdhPJy+liENE/GAbna+RBH8QCN1URLyz2EdBElXSM9NH6fYq338ai+1JXbziKklt942LS6gIA21pA== X-Received: by 2002:a62:7dcd:0:b029:25d:e0c7:46f3 with SMTP id y196-20020a627dcd0000b029025de0c746f3mr5158973pfc.53.1619788821922; Fri, 30 Apr 2021 06:20:21 -0700 (PDT) Original-Received: from [192.168.2.126] (64-52-176-132.championbroadband.com. [64.52.176.132]) by smtp.gmail.com with ESMTPSA id k22sm2355239pfa.93.2021.04.30.06.20.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Apr 2021 06:20:21 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=matt.wette@gmail.com; helo=mail-pf1-x42c.google.com 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, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:17488 Archived-At: 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: > > #!/usr/bin/env python3 > import pdb; pdb.set_trace() > some_function_that_is_going_to_fail_miserably() I started on something years ago but never got it working as nice as python, as the guile debugger still needs some help to get there.   Try this snippet. (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)))) You'll need some of this mess to resolve procedures: (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)) Matt