Changeset 1339
- Timestamp:
- 07/30/07 18:51:21 (1 year ago)
- Files:
-
- libemu/trunk/src/emu_cpu.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libemu/trunk/src/emu_cpu.c
r1320 r1339 32 32 #include <stdbool.h> 33 33 34 #include "../config.h" 35 34 36 #include "emu/emu_cpu.h" 35 37 #include "emu/emu_cpu_data.h" … … 133 135 } 134 136 135 c->instr_string = (char *)malloc( 32);137 c->instr_string = (char *)malloc(82); 136 138 c->repeat_current_instr = false; 137 139 init_prefix_map(); … … 442 444 return 0; 443 445 } 446 447 #ifdef DEBUG 448 str[81] = '\0'; 449 memset(str, 0x20, 81); 450 451 int i; 452 for (i=0;i<instrsize;i++) 453 { 454 snprintf(str+i*2, 36-2*i, "%02X", data[i]); 455 } 456 memset(str+strlen(str), 0x20, 81-strlen(str)); 457 458 459 444 460 // step 3: print it 445 get_instruction_string(&inst, FORMAT_INTEL, 0, str, 32); 446 447 return instrsize; 448 449 printf("%08x ", eip); 450 int i; 451 for (i=0; i<instrsize; i++) 452 { 453 printf("%02x", data[i]); 454 } 455 for (;i<15;i++) 456 { 457 printf(" "); 458 } 459 printf(" %s\n", str); 461 get_instruction_string(&inst, FORMAT_INTEL, 0, str, 31); 462 #endif // DEBUG 460 463 461 464 return instrsize;
