1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-02 23:50:47 +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)))) (set! *call-depth* 0))))
(define (trace-next frame) (define (trace-next frame)
(let* ((ip (frame-instruction-pointer frame)) (if *call-depth*
(objcode (program-objcode (frame-procedure frame))) (let* ((ip (frame-instruction-pointer frame))
(opcode (bytevector-u8-ref (objcode->bytecode objcode) (objcode (program-objcode (frame-procedure frame)))
(+ ip *objcode-header-len*))) (opcode (bytevector-u8-ref (objcode->bytecode objcode)
(inst (opcode->instruction opcode))) (+ ip *objcode-header-len*)))
(format #t "0x~8X: ~a: ~a\n" ip opcode inst))) (inst (opcode->instruction opcode)))
(format #t "0x~8X: ~a: ~a\n" ip opcode inst))))
(define (vm-trace-on!) (define (vm-trace-on!)
(if calls? (if calls?