Print this page
9736 kmdb tortures via single-step miscellaneous trap
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>

@@ -404,10 +404,11 @@
 
         movq    %cr3, %rax
         movq    %rax, REG_OFF(KDIREG_CR3)(%rsp)
 
         movq    REG_OFF(KDIREG_SS)(%rsp), %rax
+        movq    %rax, REG_OFF(KDIREG_SAVPC)(%rsp)
         xchgq   REG_OFF(KDIREG_RIP)(%rsp), %rax
         movq    %rax, REG_OFF(KDIREG_SS)(%rsp)
 
         movq    REG_OFF(KDIREG_RSP)(%rsp), %rax
         addq    $8, %rax

@@ -424,11 +425,16 @@
 
         ADD_CRUMB(%rax, KRM_CPU_STATE, $KDI_CPU_STATE_SLAVE, %rdx)
 
         movq    REG_OFF(KDIREG_RIP)(%rsp), %rcx
         ADD_CRUMB(%rax, KRM_PC, %rcx, %rdx)
+        movq    REG_OFF(KDIREG_RSP)(%rsp), %rcx
+        ADD_CRUMB(%rax, KRM_SP, %rcx, %rdx)
+        ADD_CRUMB(%rax, KRM_TRAPNO, $-1, %rdx)
 
+        movq    $KDI_CPU_STATE_SLAVE, KRS_CPU_STATE(%rax)
+
         pushq   %rax
         jmp     kdi_save_common_state
 
         SET_SIZE(kdi_slave_entry)