Skip to content

Commit

Permalink
log last instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
0vercl0k committed May 16, 2024
1 parent 3a793a1 commit 8cc344c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/wtf/kvm_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,15 @@ bool KvmBackend_t::OnExitDebug(struct kvm_debug_exit_arch &Debug) {
if (Stop_) {
KvmDebugPrint("The bp handler asked us to stop so no need to do the "
"step-over dance\n");

//
// Don't forget to log the last instruction in the trace.
//

if (TraceType_ == TraceType_t::Rip) {
fmt::print(TraceFile_, "{:#x}\n", Run_->s.regs.regs.rip);
}

return true;
}

Expand Down

0 comments on commit 8cc344c

Please sign in to comment.