1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-30 06:50:31 +02:00

only trace instructions inside the thunk

* module/system/vm/trace.scm (vm-trace): Only trace instructions when
  we're in the dynamic extent of the thunk.
This commit is contained in:
Andy Wingo 2010-09-16 12:58:59 +02:00
parent 8ad2fadc49
commit 839eb61cde

View file

@ -85,12 +85,13 @@
(set! *call-depth* 0))))
(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*)))
(inst (opcode->instruction opcode)))
(format #t "0x~8X: ~a: ~a\n" ip opcode inst)))
(if *call-depth*
(let* ((ip (frame-instruction-pointer frame))
(objcode (program-objcode (frame-procedure frame)))
(opcode (bytevector-u8-ref (objcode->bytecode objcode)
(+ ip *objcode-header-len*)))
(inst (opcode->instruction opcode)))
(format #t "0x~8X: ~a: ~a\n" ip opcode inst))))
(define (vm-trace-on!)
(if calls?