/[qemu]/qemu/target-i386/helper2.c
ViewVC logotype

Diff of /qemu/target-i386/helper2.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by bellard, Tue Nov 4 23:34:23 2003 UTC revision 1.4 by bellard, Wed Nov 12 23:55:40 2003 UTC
# Line 105  static const char *cc_op_str[] = { Line 105  static const char *cc_op_str[] = {
105    
106  void cpu_x86_dump_state(CPUX86State *env, FILE *f, int flags)  void cpu_x86_dump_state(CPUX86State *env, FILE *f, int flags)
107  {  {
108      int eflags;      int eflags, i;
109      char cc_op_name[32];      char cc_op_name[32];
110        static const char *seg_name[6] = { "ES", "CS", "SS", "DS", "FS", "GS" };
111    
112      eflags = env->eflags;      eflags = env->eflags;
113      fprintf(f, "EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n"      fprintf(f, "EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n"
114              "ESI=%08x EDI=%08x EBP=%08x ESP=%08x\n"              "ESI=%08x EDI=%08x EBP=%08x ESP=%08x\n"
115              "EIP=%08x EFL=%08x [%c%c%c%c%c%c%c]\n",              "EIP=%08x EFL=%08x [%c%c%c%c%c%c%c]    CPL=%d\n",
116              env->regs[R_EAX], env->regs[R_EBX], env->regs[R_ECX], env->regs[R_EDX],              env->regs[R_EAX], env->regs[R_EBX], env->regs[R_ECX], env->regs[R_EDX],
117              env->regs[R_ESI], env->regs[R_EDI], env->regs[R_EBP], env->regs[R_ESP],              env->regs[R_ESI], env->regs[R_EDI], env->regs[R_EBP], env->regs[R_ESP],
118              env->eip, eflags,              env->eip, eflags,
# Line 121  void cpu_x86_dump_state(CPUX86State *env Line 122  void cpu_x86_dump_state(CPUX86State *env
122              eflags & CC_Z ? 'Z' : '-',              eflags & CC_Z ? 'Z' : '-',
123              eflags & CC_A ? 'A' : '-',              eflags & CC_A ? 'A' : '-',
124              eflags & CC_P ? 'P' : '-',              eflags & CC_P ? 'P' : '-',
125              eflags & CC_C ? 'C' : '-');              eflags & CC_C ? 'C' : '-',
126      fprintf(f, "CS=%04x SS=%04x DS=%04x ES=%04x FS=%04x GS=%04x\n",              env->hflags & HF_CPL_MASK);
127              env->segs[R_CS].selector,      for(i = 0; i < 6; i++) {
128              env->segs[R_SS].selector,          SegmentCache *sc = &env->segs[i];
129              env->segs[R_DS].selector,          fprintf(f, "%s =%04x %08x %08x %08x\n",
130              env->segs[R_ES].selector,                  seg_name[i],
131              env->segs[R_FS].selector,                  sc->selector,
132              env->segs[R_GS].selector);                  (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        
153      if (flags & X86_DUMP_CCOP) {      if (flags & X86_DUMP_CCOP) {
154          if ((unsigned)env->cc_op < CC_OP_NB)          if ((unsigned)env->cc_op < CC_OP_NB)
155              strcpy(cc_op_name, cc_op_str[env->cc_op]);              strcpy(cc_op_name, cc_op_str[env->cc_op]);

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26