Commit 246d897f4c85cb982bef839f7723025eecb78789

Authored by bellard
1 parent 7e84c249

dump more registers


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@451 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 31 additions and 10 deletions
target-i386/helper2.c
@@ -105,13 +105,14 @@ static const char *cc_op_str[] = { @@ -105,13 +105,14 @@ static const char *cc_op_str[] = {
105 105
106 void cpu_x86_dump_state(CPUX86State *env, FILE *f, int flags) 106 void cpu_x86_dump_state(CPUX86State *env, FILE *f, int flags)
107 { 107 {
108 - int eflags; 108 + int eflags, i;
109 char cc_op_name[32]; 109 char cc_op_name[32];
  110 + static const char *seg_name[6] = { "ES", "CS", "SS", "DS", "FS", "GS" };
110 111
111 eflags = env->eflags; 112 eflags = env->eflags;
112 fprintf(f, "EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n" 113 fprintf(f, "EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n"
113 "ESI=%08x EDI=%08x EBP=%08x ESP=%08x\n" 114 "ESI=%08x EDI=%08x EBP=%08x ESP=%08x\n"
114 - "EIP=%08x EFL=%08x [%c%c%c%c%c%c%c]\n", 115 + "EIP=%08x EFL=%08x [%c%c%c%c%c%c%c] CPL=%d\n",
115 env->regs[R_EAX], env->regs[R_EBX], env->regs[R_ECX], env->regs[R_EDX], 116 env->regs[R_EAX], env->regs[R_EBX], env->regs[R_ECX], env->regs[R_EDX],
116 env->regs[R_ESI], env->regs[R_EDI], env->regs[R_EBP], env->regs[R_ESP], 117 env->regs[R_ESI], env->regs[R_EDI], env->regs[R_EBP], env->regs[R_ESP],
117 env->eip, eflags, 118 env->eip, eflags,
@@ -121,14 +122,34 @@ void cpu_x86_dump_state(CPUX86State *env, FILE *f, int flags) @@ -121,14 +122,34 @@ void cpu_x86_dump_state(CPUX86State *env, FILE *f, int flags)
121 eflags & CC_Z ? 'Z' : '-', 122 eflags & CC_Z ? 'Z' : '-',
122 eflags & CC_A ? 'A' : '-', 123 eflags & CC_A ? 'A' : '-',
123 eflags & CC_P ? 'P' : '-', 124 eflags & CC_P ? 'P' : '-',
124 - eflags & CC_C ? 'C' : '-');  
125 - fprintf(f, "CS=%04x SS=%04x DS=%04x ES=%04x FS=%04x GS=%04x\n",  
126 - env->segs[R_CS].selector,  
127 - env->segs[R_SS].selector,  
128 - env->segs[R_DS].selector,  
129 - env->segs[R_ES].selector,  
130 - env->segs[R_FS].selector,  
131 - env->segs[R_GS].selector); 125 + eflags & CC_C ? 'C' : '-',
  126 + env->hflags & HF_CPL_MASK);
  127 + for(i = 0; i < 6; i++) {
  128 + SegmentCache *sc = &env->segs[i];
  129 + fprintf(f, "%s =%04x %08x %08x %08x\n",
  130 + seg_name[i],
  131 + sc->selector,
  132 + (int)sc->base,
  133 + sc->limit,
  134 + sc->flags);
  135 + }
  136 + fprintf(f, "LDT=%04x %08x %08x %08x\n",
  137 + env->ldt.selector,
  138 + (int)env->ldt.base,
  139 + env->ldt.limit,
  140 + env->ldt.flags);
  141 + fprintf(f, "TR =%04x %08x %08x %08x\n",
  142 + env->tr.selector,
  143 + (int)env->tr.base,
  144 + env->tr.limit,
  145 + env->tr.flags);
  146 + fprintf(f, "GDT= %08x %08x\n",
  147 + (int)env->gdt.base, env->gdt.limit);
  148 + fprintf(f, "IDT= %08x %08x\n",
  149 + (int)env->idt.base, env->idt.limit);
  150 + fprintf(f, "CR0=%08x CR2=%08x CR3=%08x CR4=%08x\n",
  151 + env->cr[0], env->cr[2], env->cr[3], env->cr[4]);
  152 +
132 if (flags & X86_DUMP_CCOP) { 153 if (flags & X86_DUMP_CCOP) {
133 if ((unsigned)env->cc_op < CC_OP_NB) 154 if ((unsigned)env->cc_op < CC_OP_NB)
134 strcpy(cc_op_name, cc_op_str[env->cc_op]); 155 strcpy(cc_op_name, cc_op_str[env->cc_op]);