unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Janneke Nieuwenhuizen <janneke@gnu.org>
To: "Dr. Arne Babenhauserheide" <arne_bab@web.de>
Cc: Olivier Dion <olivier.dion@polymtl.ca>,  guile-devel@gnu.org
Subject: Re: A Guile debugger workgroup?
Date: Fri, 03 Mar 2023 11:28:27 +0100	[thread overview]
Message-ID: <87wn3y1644.fsf@gnu.org> (raw)
In-Reply-To: <87fsana8m9.fsf@web.de> (Arne Babenhauserheide's message of "Thu,  02 Mar 2023 08:54:23 +0100")

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]

Dr. Arne Babenhauserheide writes:

Hi Arne,

> Jannneke Nieuwenhuizen <janneke@gnu.org> writes:
>> In 2014, I wrote patches for Guile to use a debug prompt that GUD can
>> work with.  The Guile debug patches didn't make it into Guile, but the
>> Emacs GUD integration is part of Emacs.
>>
>>    https://lists.gnu.org/archive/html/guile-devel/2014-08/msg00004.html
>
> What were the reasons these didn’t make it?

No idea, there was no comment or interest in the patch.  I believe the
consensus was (is?) to use pk for debugging.  FWIW, I'm using my own
"pke", because many of my programs are (pseudo-)filters, writing their
output to stdout, which makes "pk" not so handy.  See attached.
> I now have push-access, so if these get acked by someone who knows that
> part well enough, I can take up the integration.

That's nice, but it probably needs to be updated and it certainly needs
some discussion.

Greetings,
Janneke


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-peek-error-pke.patch --]
[-- Type: text/x-patch, Size: 1142 bytes --]

From 98264afe030eef3b5bbabc03b76808253ce10d14 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Date: Fri, 3 Mar 2023 11:26:34 +0100
Subject: [PATCH] Add peek-error, pke.

Debuging using `pk' is popular in Guile, but not really usable if your
program is as (pseudo-)filter, i.e., writing its output to stdout.

* module/ice-9/boot-9.scm (peek-error, pke): New procedures.
---
 module/ice-9/boot-9.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index dc3537063..639aaaa79 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -183,6 +183,16 @@ This is handy for tracing function calls, e.g.:
 
 (define pk peek)
 
+(define (peek-error . stuff)
+  "Like peek (peok), writing to (CURRENT-ERROR-PORT)."
+  (newline (current-error-port))
+  (display ";;; " (current-error-port))
+  (write stuff (current-error-port))
+  (newline (current-error-port))
+  (car (last-pair stuff)))
+
+(define pke peek-error)
+
 (define (warn . stuff)
   (newline (current-warning-port))
   (display ";;; WARNING " (current-warning-port))
-- 
2.39.1


[-- Attachment #3: Type: text/plain, Size: 164 bytes --]


-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com

  reply	other threads:[~2023-03-03 10:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 17:21 A Guile debugger workgroup? Olivier Dion via Developers list for Guile, the GNU extensibility library
2022-11-29 17:58 ` Neil Jerram
2023-03-01 15:59   ` Maxim Cournoyer
2022-11-29 20:18 ` Damien Mattei
2023-03-02  6:18 ` Jannneke Nieuwenhuizen
2023-03-02  7:54   ` Dr. Arne Babenhauserheide
2023-03-03 10:28     ` Janneke Nieuwenhuizen [this message]
2023-03-03 10:30       ` Jan Nieuwenhuizen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wn3y1644.fsf@gnu.org \
    --to=janneke@gnu.org \
    --cc=arne_bab@web.de \
    --cc=guile-devel@gnu.org \
    --cc=olivier.dion@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).