Commit 88fe8a41f2abbee28948626a4e6426d17f0498bf

Authored by ths
1 parent b3ceef24

DR6 single step exception status bit, by Juergen Keil.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3024 c046a42c-6fe2-441c-8c8c-71466251a162
target-i386/exec.h
@@ -190,6 +190,7 @@ void helper_divq_EAX_T0(void); @@ -190,6 +190,7 @@ void helper_divq_EAX_T0(void);
190 void helper_idivq_EAX_T0(void); 190 void helper_idivq_EAX_T0(void);
191 void helper_bswapq_T0(void); 191 void helper_bswapq_T0(void);
192 void helper_cmpxchg8b(void); 192 void helper_cmpxchg8b(void);
  193 +void helper_single_step(void);
193 void helper_cpuid(void); 194 void helper_cpuid(void);
194 void helper_enter_level(int level, int data32); 195 void helper_enter_level(int level, int data32);
195 void helper_enter64_level(int level, int data64); 196 void helper_enter64_level(int level, int data64);
target-i386/helper.c
@@ -1622,6 +1622,12 @@ void helper_cmpxchg8b(void) @@ -1622,6 +1622,12 @@ void helper_cmpxchg8b(void)
1622 CC_SRC = eflags; 1622 CC_SRC = eflags;
1623 } 1623 }
1624 1624
  1625 +void helper_single_step()
  1626 +{
  1627 + env->dr[6] |= 0x4000;
  1628 + raise_exception(EXCP01_SSTP);
  1629 +}
  1630 +
1625 void helper_cpuid(void) 1631 void helper_cpuid(void)
1626 { 1632 {
1627 uint32_t index; 1633 uint32_t index;
target-i386/op.c
@@ -730,6 +730,11 @@ void OPPROTO op_cmpxchg8b(void) @@ -730,6 +730,11 @@ void OPPROTO op_cmpxchg8b(void)
730 helper_cmpxchg8b(); 730 helper_cmpxchg8b();
731 } 731 }
732 732
  733 +void OPPROTO op_single_step(void)
  734 +{
  735 + helper_single_step();
  736 +}
  737 +
733 void OPPROTO op_movl_T0_0(void) 738 void OPPROTO op_movl_T0_0(void)
734 { 739 {
735 T0 = 0; 740 T0 = 0;
target-i386/translate.c
@@ -2277,7 +2277,7 @@ static void gen_eob(DisasContext *s) @@ -2277,7 +2277,7 @@ static void gen_eob(DisasContext *s)
2277 if (s->singlestep_enabled) { 2277 if (s->singlestep_enabled) {
2278 gen_op_debug(); 2278 gen_op_debug();
2279 } else if (s->tf) { 2279 } else if (s->tf) {
2280 - gen_op_raise_exception(EXCP01_SSTP); 2280 + gen_op_single_step();
2281 } else { 2281 } else {
2282 gen_op_movl_T0_0(); 2282 gen_op_movl_T0_0();
2283 gen_op_exit_tb(); 2283 gen_op_exit_tb();