anchor.diff:           (format t " rip: ~8,'0X~%" (sys.int::memref-unsigned-byte-64 (mezzano.supervisor:thread-state-rsp thread) 0))))
     (values))
   
  -(defun trace-execution (function &key full-dump run-forever (print-instructions t))
  +(defun trace-execution (function &key full-dump run-forever (print-instructions t) trace-call-mode (trim-stepper-noise t))
     (check-type function function)
     (let* ((next-stop-boundary 10000)
            (stopped nil)
  +         (terminal-io *terminal-io*)
  +         (standard-input *standard-input*)
  +         (standard-output *standard-output*)
  +         (error-output *error-output*)
  +         (trace-output *trace-output*)
  +         (debug-io *debug-io*)
  +         (query-io *query-io*)
            (thread (mezzano.supervisor:make-thread
                     (lambda ()
  -                    (loop
  -                       (when stopped
  -                         (return))
  -                       (mezzano.supervisor:thread-yield))
  -                    (funcall function))
  +                    (let ((*terminal-io* terminal-io)
  +                          (*standard-input* standard-input)
  +                          (*standard-output* standard-output)
  +                          (*error-output* error-output)
  +                          (*trace-output* trace-output)
  +                          (*debug-io* debug-io)
  +                          (*query-io* query-io)
  +                          (*the-debugger* (lambda (condition)
  +                                            (declare (ignore condition))
  +                                            (throw 'mezzano.supervisor:terminate-thread nil))))
  +                      (loop
  +                         (when stopped
  +                           (return))
  +                         (mezzano.supervisor:thread-yield))
  +                      (funcall function)))
                     :name "Trace thread"))
            (instructions-stepped 0)
            (prev-fn nil)
            (disassembler-context (mezzano.disassemble:make-disassembler-context function))
            (in-single-step-wrapper nil)
            (single-step-wrapper-sp nil)
  -         (prestart t)
  +         (prestart trim-stepper-noise)
            (entry-sp nil)
            (fundamental-function (mezzano.disassemble::peel-function function)))
       (mezzano.supervisor::stop-thread thread)
  
positive.code:                         (mezzano.supervisor:thread-state-r12-value thread)))
          (sp (mezzano.supervisor:thread-state-rsp thread))
          (stack-vals '()))
      (dotimes (i (max 0 (- count 5)))
        (push (memref-t sp (1+ i)) stack-vals))
      (subseq (append reg-vals (reverse stack-vals))
              0 count)))
  
  (defun fetch-thread-return-values (thread)
    (let ((count (mezzano.supervisor:thread-state-rcx-value thread))
          (vals (list (mezzano.supervisor:thread-state-r12-value thread)
                      (mezzano.supervisor:thread-state-r11-value thread)
                      (mezzano.supervisor:thread-state-r10-value thread)
                      (mezzano.supervisor:thread-state-r9-value thread)
                      (mezzano.supervisor:thread-state-r8-value thread))))
      (dotimes (i (max 0 (- count 5)))
        (push (%object-ref-t thread (+ mezzano.supervisor::+thread-mv-slots-start+ i)) vals))
      (subseq (reverse vals) 0 count)))
  
negative.code:                   (setf entry-sp (mezzano.supervisor:thread-state-rsp thread))
                    (setf prestart nil))
                  (cond (prestart)
                        ((and trim-stepper-noise
                              (not in-single-step-wrapper)
                              (eql fn #'single-step-wrapper))
                         (setf single-step-wrapper-sp (mezzano.supervisor:thread-state-rsp thread))
                         (setf in-single-step-wrapper t))
  