mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-30 06:50:31 +02:00
inspector integration in debugger
* module/system/vm/debug.scm: Integrate with the inspector. Add a "procedure" command.
This commit is contained in:
parent
f3a1fc5a9e
commit
e106eca674
1 changed files with 12 additions and 1 deletions
|
@ -26,6 +26,7 @@
|
|||
#:use-module (ice-9 rdelim)
|
||||
#:use-module (ice-9 pretty-print)
|
||||
#:use-module (ice-9 format)
|
||||
#:use-module ((system vm inspect) #:select ((inspect . %inspect)))
|
||||
#:use-module (system vm program)
|
||||
#:export (run-debugger debug-pre-unwind-handler))
|
||||
|
||||
|
@ -161,7 +162,8 @@
|
|||
(let ((top frame)
|
||||
(cur frame)
|
||||
(index 0)
|
||||
(level (debugger-level db)))
|
||||
(level (debugger-level db))
|
||||
(last #f))
|
||||
(define (frame-index frame)
|
||||
(let lp ((idx 0) (walk top))
|
||||
(if (= (frame-return-address frame) (frame-return-address walk))
|
||||
|
@ -203,6 +205,7 @@
|
|||
(define (print* . vals)
|
||||
(define (print x)
|
||||
(run-hook before-print-hook x)
|
||||
(set! last x)
|
||||
(pretty-print x))
|
||||
(if (and (pair? vals)
|
||||
(not (and (null? (cdr vals))
|
||||
|
@ -266,6 +269,14 @@ With an argument, select a frame by index, then show it."
|
|||
(format #t "No such frame.~%"))))
|
||||
(else (show-frame))))
|
||||
|
||||
(define-command ((commands procedure proc))
|
||||
"Print the procedure for the selected frame."
|
||||
(print* (frame-procedure cur)))
|
||||
|
||||
(define-command ((commands inspect i))
|
||||
"Launch the inspector on the last-printed object."
|
||||
(%inspect last))
|
||||
|
||||
(define-command ((commands locals))
|
||||
"Show locally-bound variables in the selected frame."
|
||||
(print-locals cur))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue