summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2013-11-08 17:32:41 +0100
committerAndy Wingo <wingo@pobox.com>2013-11-08 17:32:41 +0100
commitb77a5215c7dbee6c88ab9614942c9b0866c3ab0b (patch)
tree3e0c04d859c8e0f8157820e1f6451f060828cd75
parente391f179e47bf36ce34c7e880250e3f2f383773f (diff)
downloadguile-b77a5215c7dbee6c88ab9614942c9b0866c3ab0b.tar.gz
Per-instruction tracing doesn't try to disassemble stack VM code
* module/system/vm/trace.scm (trace-instructions-in-procedure): Don't try to disassemble the procedure, for now.
-rw-r--r--module/system/vm/trace.scm12
1 files changed, 3 insertions, 9 deletions
diff --git a/module/system/vm/trace.scm b/module/system/vm/trace.scm
index 7b96af5bd..7657be4e1 100644
--- a/module/system/vm/trace.scm
+++ b/module/system/vm/trace.scm
@@ -23,7 +23,6 @@
#:use-module (system vm vm)
#:use-module (system vm frame)
#:use-module (system vm program)
- #:use-module (system vm objcode)
#:use-module (system vm traps)
#:use-module (rnrs bytevectors)
#:use-module (system vm instruction)
@@ -33,9 +32,6 @@
trace-instructions-in-procedure
call-with-trace))
-;; FIXME: this constant needs to go in system vm objcode
-(define *objcode-header-len* 8)
-
(define (build-prefix prefix depth infix numeric-format max-indent)
(let lp ((indent "") (n 0))
(cond
@@ -96,11 +92,9 @@
(define* (trace-instructions-in-procedure proc #:key (width 80) (vm (the-vm))
(max-indent (- width 40)))
(define (trace-next frame)
- (let* ((ip (frame-instruction-pointer frame))
- (objcode (program-objcode (frame-procedure frame)))
- (opcode (bytevector-u8-ref (objcode->bytecode objcode)
- (+ ip *objcode-header-len*))))
- (format #t "~8d: ~a\n" ip (opcode->instruction opcode))))
+ ;; FIXME: We could disassemble this instruction here.
+ (let ((ip (frame-instruction-pointer frame)))
+ (format #t "0x~x\n" ip)))
(trap-instructions-in-dynamic-extent proc trace-next
#:vm vm))