aartaka / graven-image

Portability library for better interaction and debugging of a running Common Lisp image through text REPL.
BSD 3-Clause "New" or "Revised" License
19 stars 3 forks source link

BREAK* #30

Closed aartaka closed 11 months ago

aartaka commented 12 months ago

I often find myself wanting to use break for debugging, but making a good and understandable breakpoint takes:

While it all is accessible in the debugger opening for break, some more immediate info won't hurt. So the intuition for break* possible use:

;; Logging the function and args automatically:
(break "Function (~s ~{~s^ ~})." 'fn '(foo 37 a))
(break*) ;; Implying function name and args.
;; Listing the value for variable:
(break "Value for ~a is ~s" 'v v)
(break* :var v)
;; Listing data and a provided message.
(break "Function (~s ~{~s^ ~}): Message." 'fn '(foo 37 a))
(break* "Message.")

Ways to get the current stack frame (mostly from Dissect):