Diff for /np2/i386c/ia32/debug.c between versions 1.15 and 1.25

version 1.15, 2011/01/15 17:17:23 version 1.25, 2012/06/18 14:11:56
Line 32 Line 32
 #endif  #endif
   
   
   /*
    * register strings
    */
   const char *reg8_str[CPU_REG_NUM] = {
           "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh"
   };
   
   const char *reg16_str[CPU_REG_NUM] = { 
           "ax", "cx", "dx", "bx", "sp", "bp", "si", "di"
   };
   
   const char *reg32_str[CPU_REG_NUM] = { 
           "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi"
   };
   
   const char *sreg_str[CPU_SEGREG_NUM] = {
           "es", "cs", "ss", "ds", "fs", "gs"
   };
   
   
 char *  char *
 cpu_reg2str(void)  cpu_reg2str(void)
 {  {
Line 41  cpu_reg2str(void) Line 61  cpu_reg2str(void)
             "eax=%08x ecx=%08x edx=%08x ebx=%08x\n"              "eax=%08x ecx=%08x edx=%08x ebx=%08x\n"
             "esp=%08x ebp=%08x esi=%08x edi=%08x\n"              "esp=%08x ebp=%08x esi=%08x edi=%08x\n"
             "eip=%08x prev_eip=%08x\n"              "eip=%08x prev_eip=%08x\n"
             "es=%04x cs=%04x ss=%04x ds=%04x fs=%04x gs=%04x\n"              "cs=%04x ss=%04x ds=%04x es=%04x fs=%04x gs=%04x\n"
             "eflag=%08x "              "eflag=%08x "
             /* ID VIP VIF AC VM RF NT IOPL OF DF IF TF SF ZF AF PF CF */              /* ID VIP VIF AC VM RF NT IOPL OF DF IF TF SF ZF AF PF CF */
             "[ ID=%d VIP=%d VIF=%d AC=%d VM=%d RF=%d NT=%d IOPL=%d %s %s %s TF=%d %s %s %s %s %s ]\n"              "[ ID=%d VIP=%d VIF=%d AC=%d VM=%d RF=%d NT=%d IOPL=%d %s %s %s TF=%d %s %s %s %s %s ]\n"
Line 101  put_cpuinfo(void) Line 121  put_cpuinfo(void)
 #endif  #endif
         strcat(buf, a20str());          strcat(buf, a20str());
   
         printf(buf);          printf("%s", buf);
 }  }
   
 void  void
Line 115  dbg_printf(const char *str, ...) Line 135  dbg_printf(const char *str, ...)
         va_end(ap);          va_end(ap);
         strcat(buf, "\n");          strcat(buf, "\n");
   
         printf(buf);          printf("%s", buf);
 }  }
   
 void  void
 memory_dump(int idx, UINT32 madr)  memory_dump(int idx, UINT32 madr)
 {  {
         UINT32 addr;          UINT32 addr;
         size_t size;          UINT32 size;
         size_t s, i;          UINT32 s, i;
         UINT8 buf[16];          UINT8 buf[16];
         UINT8 c;          UINT8 c;
   
Line 134  memory_dump(int idx, UINT32 madr) Line 154  memory_dump(int idx, UINT32 madr)
                 size = 0x100;                  size = 0x100;
                 addr = madr - 0x80;                  addr = madr - 0x80;
         }          }
         VERBOSE(("memory dump\n-- \n"));          VERBOSE(("memory dump\n--"));
         for (s = 0; s < size; s++) {          for (s = 0; s < size; s++) {
                 if ((s % 16) == 0) {                  if ((s % 16) == 0) {
                         VERBOSE(("%08x: ", addr + s));                          VERBOSE(("%08x: ", addr + s));
Line 206  tr_dump(UINT16 selector, UINT32 base, UI Line 226  tr_dump(UINT16 selector, UINT32 base, UI
         UINT32 v;          UINT32 v;
         UINT i;          UINT i;
   
         (void)selector;  
   
         VERBOSE(("TR_DUMP: selector = %04x", selector));          VERBOSE(("TR_DUMP: selector = %04x", selector));
   
         for (i = 0; i < limit; i += 4) {          for (i = 0; i < limit; i += 4) {
Line 253  segdesc_dump(descriptor_t *sdp) Line 271  segdesc_dump(descriptor_t *sdp)
   
         __ASSERT(sdp != NULL);          __ASSERT(sdp != NULL);
   
         VERBOSE(("\ndump descriptor", sdp));          VERBOSE(("dump descriptor: %p", sdp));
   
         VERBOSE(("valid    : %s", SEG_IS_VALID(sdp) ? "true" : "false"));          VERBOSE(("valid    : %s", SEG_IS_VALID(sdp) ? "true" : "false"));
         VERBOSE(("present  : %s", SEG_IS_PRESENT(sdp) ? "true" : "false"));          VERBOSE(("present  : %s", SEG_IS_PRESENT(sdp) ? "true" : "false"));
         VERBOSE(("DPL      : %d", sdp->dpl));          VERBOSE(("DPL      : %d", sdp->dpl));
           VERBOSE(("type     : %d", sdp->type));
         VERBOSE(("kind     : %s", SEG_IS_SYSTEM(sdp) ? "system" : "code/data"));          VERBOSE(("kind     : %s", SEG_IS_SYSTEM(sdp) ? "system" : "code/data"));
         if (!SEG_IS_SYSTEM(sdp)) {          if (!SEG_IS_SYSTEM(sdp)) {
                 if (SEG_IS_CODE(sdp)) {                  if (SEG_IS_CODE(sdp)) {
                         VERBOSE(("type     : %sconforming code",                          VERBOSE(("type     : %dbit %sconforming code",
                               SEG_IS_32BIT(sdp) ? 32 : 16,
                             SEG_IS_CONFORMING_CODE(sdp) ? "" : "non-"));                              SEG_IS_CONFORMING_CODE(sdp) ? "" : "non-"));
                         VERBOSE(("access   : execute%s",                          VERBOSE(("access   : execute%s",
                             SEG_IS_READABLE_CODE(sdp) ? "/read" : ""));                              SEG_IS_READABLE_CODE(sdp) ? "/read" : ""));
                 } else {                  } else {
                         VERBOSE(("type     : expand-%s data",                          VERBOSE(("type     : %dbit expand-%s data",
                               SEG_IS_32BIT(sdp) ? 32 : 16,
                             SEG_IS_EXPANDDOWN_DATA(sdp) ? "down" : "up"));                              SEG_IS_EXPANDDOWN_DATA(sdp) ? "down" : "up"));
                         VERBOSE(("access   : read%s",                          VERBOSE(("access   : read%s",
                             SEG_IS_WRITABLE_DATA(sdp) ? "/write" : ""));                              SEG_IS_WRITABLE_DATA(sdp) ? "/write" : ""));
Line 337  segdesc_dump(descriptor_t *sdp) Line 358  segdesc_dump(descriptor_t *sdp)
                         break;                          break;
                 }                  }
         }          }
         VERBOSE(("\n"));  
 #else  
         (void)sdp;  
 #endif  #endif
 }  }
   

Removed from v.1.15  
changed lines
  Added in v.1.25


RetroPC.NET-CVS <cvs@retropc.net>