Commit dc6f57fd55d03546197dc0ea96b743fffe7b8f75

Authored by bellard
1 parent 65262d57

debug updates - page_unprotect() is no longer needed in softmmu case


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@505 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 28 additions and 12 deletions
target-i386/helper.c
@@ -281,6 +281,10 @@ static void switch_tss(int tss_selector, @@ -281,6 +281,10 @@ static void switch_tss(int tss_selector,
281 uint8_t *ptr; 281 uint8_t *ptr;
282 282
283 type = (e2 >> DESC_TYPE_SHIFT) & 0xf; 283 type = (e2 >> DESC_TYPE_SHIFT) & 0xf;
  284 +#ifdef DEBUG_PCALL
  285 + if (loglevel)
  286 + fprintf(logfile, "switch_tss: sel=0x%04x type=%d src=%d\n", tss_selector, type, source);
  287 +#endif
284 288
285 /* if task gate, we read the TSS segment and we load it */ 289 /* if task gate, we read the TSS segment and we load it */
286 if (type == 5) { 290 if (type == 5) {
@@ -848,24 +852,40 @@ void do_interrupt(int intno, int is_int, int error_code, @@ -848,24 +852,40 @@ void do_interrupt(int intno, int is_int, int error_code,
848 { 852 {
849 extern FILE *stdout; 853 extern FILE *stdout;
850 static int count; 854 static int count;
851 - if (env->cr[0] & CR0_PE_MASK) {  
852 - fprintf(stdout, "%d: interrupt: vector=%02x error_code=%04x int=%d\n",  
853 - count, intno, error_code, is_int); 855 + if ((env->cr[0] && CR0_PE_MASK)) {
  856 + fprintf(stdout, "%d: interrupt: vector=%02x error_code=%04x int=%d CPL=%d CS:EIP=%04x:%08x SS:ESP=%04x:%08x EAX=%08x\n",
  857 + count, intno, error_code, is_int,
  858 + env->hflags & HF_CPL_MASK,
  859 + env->segs[R_CS].selector, EIP,
  860 + env->segs[R_SS].selector, ESP,
  861 + EAX);
  862 + if (0) {
  863 + cpu_x86_dump_state(env, stdout, X86_DUMP_CCOP);
  864 +#if 0
  865 + {
  866 + int i;
  867 + uint8_t *ptr;
  868 + fprintf(stdout, " code=");
  869 + ptr = env->segs[R_CS].base + env->eip;
  870 + for(i = 0; i < 16; i++) {
  871 + fprintf(stdout, " %02x", ldub(ptr + i));
  872 + }
  873 + fprintf(stdout, "\n");
  874 + }
  875 +#endif
  876 + }
854 count++; 877 count++;
855 } 878 }
856 } 879 }
857 - if ((env->cr[0] & CR0_PE_MASK) && intno == 0x10) {  
858 - tb_flush(env);  
859 - cpu_set_log(CPU_LOG_ALL);  
860 - }  
861 #endif 880 #endif
  881 +
862 #ifdef DEBUG_PCALL 882 #ifdef DEBUG_PCALL
863 if (loglevel) { 883 if (loglevel) {
864 static int count; 884 static int count;
865 fprintf(logfile, "%d: interrupt: vector=%02x error_code=%04x int=%d\n", 885 fprintf(logfile, "%d: interrupt: vector=%02x error_code=%04x int=%d\n",
866 count, intno, error_code, is_int); 886 count, intno, error_code, is_int);
867 cpu_x86_dump_state(env, logfile, X86_DUMP_CCOP); 887 cpu_x86_dump_state(env, logfile, X86_DUMP_CCOP);
868 -#if 1 888 +#if 0
869 { 889 {
870 int i; 890 int i;
871 uint8_t *ptr; 891 uint8_t *ptr;
@@ -2431,10 +2451,6 @@ void tlb_fill(unsigned long addr, int is_write, int is_user, void *retaddr) @@ -2431,10 +2451,6 @@ void tlb_fill(unsigned long addr, int is_write, int is_user, void *retaddr)
2431 generated code */ 2451 generated code */
2432 saved_env = env; 2452 saved_env = env;
2433 env = cpu_single_env; 2453 env = cpu_single_env;
2434 - if (is_write && page_unprotect(addr)) {  
2435 - /* nothing more to do: the page was write protected because  
2436 - there was code in it. page_unprotect() flushed the code. */  
2437 - }  
2438 2454
2439 ret = cpu_x86_handle_mmu_fault(env, addr, is_write, is_user, 1); 2455 ret = cpu_x86_handle_mmu_fault(env, addr, is_write, is_user, 1);
2440 if (ret) { 2456 if (ret) {