1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-22 20:40:29 +02:00

list-traps just returns trap identifiers, not names

* module/system/vm/trap-state.scm (list-traps): Just return the integers
  identifying the traps; people can use trap-name to get the names.

* module/system/repl/command.scm (traps): Adapt.
This commit is contained in:
Andy Wingo 2010-09-23 17:26:12 +02:00
parent 1241f6944b
commit 665196884f
2 changed files with 4 additions and 7 deletions

View file

@ -596,13 +596,13 @@ called, and its return value(s) when it returns."
"traps
Show the set of currently attached traps.
Show the set of currently attached traps (breakpoints)."
Show the set of currently attached traps (breakpoints and tracepoints)."
(let ((traps (list-traps)))
(if (null? traps)
(format #t "No traps enabled.~%")
(format #t "No traps set.~%")
(for-each (lambda (idx name)
(format #t " ~a: ~a~a~%"
idx name
idx (trap-name idx)
(if (trap-enabled? idx) "" " (disabled)")))
(map car traps) (map cdr traps)))))

View file

@ -157,10 +157,7 @@
(set-vm-trace-level! (the-vm) 0))))))
(define* (list-traps #:optional (trap-state (the-trap-state)))
(map (lambda (wrapper)
(cons (trap-wrapper-index wrapper)
(trap-wrapper-name wrapper)))
(trap-state-wrappers trap-state)))
(map trap-wrapper-index (trap-state-wrappers trap-state)))
(define* (trap-name idx #:optional (trap-state (the-trap-state)))
(and=> (wrapper-at-index trap-state idx)