Skip to content

Commit

Permalink
step-event-example: fix mem_event setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Tarral committed Feb 14, 2018
1 parent 91a430c commit 222c094
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/step-event-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ int main (int argc, char **argv)
{
vmi_instance_t vmi = NULL;
status_t status = VMI_SUCCESS;
addr_t gfn;

struct sigaction act;

Expand Down Expand Up @@ -178,9 +179,10 @@ int main (int argc, char **argv)
vmi_translate_uv2p(vmi, rip, pid, &rip_pa);
}

gfn = rip_pa >> 12;
printf("Preparing memory event to catch next RIP 0x%lx, PA 0x%lx, page 0x%lx for PID %u\n",
rip, rip_pa, rip_pa >> 12, pid);
SETUP_MEM_EVENT(&mm_event, rip_pa, VMI_MEMACCESS_X, mm_callback, 0);
rip, rip_pa, gfn, pid);
SETUP_MEM_EVENT(&mm_event, gfn, VMI_MEMACCESS_X, mm_callback, 0);

vmi_resume_vm(vmi);

Expand Down

0 comments on commit 222c094

Please sign in to comment.