unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Ekaitz Zarraga <ekaitz@elenq.tech>
To: guile-devel@gnu.org, 56515@debbugs.gnu.org
Subject: bug#56515: [PATCH] Add ,delete-all to delete all traps
Date: Tue, 12 Jul 2022 08:47:18 +0000	[thread overview]
Message-ID: <plpdn0kNvpUbn6F99THTWY_QuhorDWoyCkGf2WE6qP-whS8KPFp9hW0nqqjcW3gcCaUWX8CASgvnLyRLPrcZtKRTROWaCjfpVHxBzINMGSQ=@elenq.tech> (raw)

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

Hi all,

I attach a patch to add a ,delete-all or ,dela command to the REPL that deletes
all traps.

I considered it could be useful once the debugging is done to be able to
continue with the normal execution of the program.

I hope it's useful.

Ekaitz

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-delete-all-to-delete-all-traps.patch --]
[-- Type: text/x-patch; name=0001-Add-delete-all-to-delete-all-traps.patch, Size: 1336 bytes --]

From 066d20e1f0a2b4bb864d23517c96f8fb94b9bdcb Mon Sep 17 00:00:00 2001
From: Ekaitz Zarraga <ekaitz@elenq.tech>
Date: Tue, 12 Jul 2022 10:05:46 +0200
Subject: [PATCH] Add ,delete-all to delete all traps

* module/system/repl/command.scm (delete-all): New meta-command.
---
 module/system/repl/command.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/module/system/repl/command.scm b/module/system/repl/command.scm
index ac1fa0933..3eb383c63 100644
--- a/module/system/repl/command.scm
+++ b/module/system/repl/command.scm
@@ -65,7 +65,7 @@
               (next n) (next-instruction ni)
               (finish)
               (tracepoint tp)
-              (traps) (delete del) (disable) (enable)
+              (traps) (delete del) (delete-all dela) (disable) (enable)
               (registers regs))
     (inspect  (inspect i) (pretty-print pp))
     (system   (gc) (statistics stat) (option o)
@@ -806,6 +806,13 @@ Delete a trap."
       (error "expected a trap index (a non-negative integer)" idx)
       (delete-trap! idx)))
 
+(define-meta-command (delete-all repl)
+  "delete-all
+Delete all traps.
+
+Delete all traps."
+(map delete-trap! (list-traps)))
+
 (define-meta-command (disable repl idx)
   "disable IDX
 Disable a trap.

base-commit: 118ee0c50ba90ea7ad7ff1fd2a212bbbb7a66d99
-- 
2.36.1


                 reply	other threads:[~2022-07-12  8:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='plpdn0kNvpUbn6F99THTWY_QuhorDWoyCkGf2WE6qP-whS8KPFp9hW0nqqjcW3gcCaUWX8CASgvnLyRLPrcZtKRTROWaCjfpVHxBzINMGSQ=@elenq.tech' \
    --to=ekaitz@elenq.tech \
    --cc=56515@debbugs.gnu.org \
    --cc=guile-devel@gnu.org \
    /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).