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
From 066d20e1f0a2b4bb864d23517c96f8fb94b9bdcb Mon Sep 17 00:00:00 2001
From: Ekaitz Zarraga <eka...@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 via email to