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

,registers doesn't use frame-procedure

* module/system/repl/debug.scm (print-registers): Avoid frame-procedure,
  and be more useful and print an offset in units of 4 bytes.
This commit is contained in:
Andy Wingo 2015-11-27 12:53:34 +01:00
parent c960c76fe0
commit 2d0214a9b7

View file

@ -24,6 +24,7 @@
#:use-module (system base language)
#:use-module (system vm vm)
#:use-module (system vm frame)
#:use-module (system vm debug)
#:use-module (ice-9 rdelim)
#:use-module (ice-9 pretty-print)
#:use-module (ice-9 format)
@ -94,12 +95,13 @@
(format port fmt val))
(format port "~aRegisters:~%" per-line-prefix)
(print "ip = #x~x" (frame-instruction-pointer frame))
(when (program? (frame-procedure frame))
(let ((code (program-code (frame-procedure frame))))
(format port " (#x~x~@d)" code
(- (frame-instruction-pointer frame) code))))
(newline port)
(let ((ip (frame-instruction-pointer frame)))
(print "ip = #x~x" ip)
(let ((info (find-program-debug-info ip)))
(when info
(let ((addr (program-debug-info-addr info)))
(format port " (#x~x + ~d * 4)" addr (/ (- ip addr) 4)))))
(newline port))
(print "sp = ~a\n" (frame-stack-pointer frame))
(print "fp = ~a\n" (frame-address frame)))