Index: src/trusted/validator/x86/testing/enuminsts/xed_tester.c |
=================================================================== |
--- src/trusted/validator/x86/testing/enuminsts/xed_tester.c (revision 8119) |
+++ src/trusted/validator/x86/testing/enuminsts/xed_tester.c (working copy) |
@@ -151,38 +151,25 @@ |
/* Prints out the disassembled instruction. */ |
static void PrintInst(NaClEnumerator* enumerator) { |
int i; |
- if (enumerator->_print_opcode_bytes_only) { |
- for (i = 0; i < xed_decoder._xedd._decoded_length; ++i) { |
- printf("%02x", enumerator->_itext[i]); |
- } |
- printf("\n"); |
- } else { |
- size_t opcode_size; |
- if (!enumerator->_print_enumerated_instruction) { |
- NaClPcAddress pc_address = (NaClPcAddress) xed_decoder._pc_address; |
- printf(" XED: %"NACL_PRIxNaClPcAddressAll": ", pc_address); |
- } |
- /* Since xed doesn't print out opcode sequence, and it is |
- * useful to know, add it to the print out. Note: Use same |
- * spacing scheme as nacl decoder, so things line up. |
- */ |
- size_t num_bytes = MAX_INST_LENGTH; |
- if (enumerator->_num_bytes > num_bytes) |
- num_bytes = enumerator->_num_bytes; |
- for (i = 0; i < num_bytes; ++i) { |
- if (i < xed_decoder._xedd._decoded_length) { |
- printf("%02x ", enumerator->_itext[i]); |
- } else if (!enumerator->_print_enumerated_instruction) { |
- printf(" "); |
- } |
- } |
- if (enumerator->_print_enumerated_instruction) { |
- printf("#%s %s\n", GetInstMnemonic(enumerator), |
- GetInstOperandsText(enumerator)); |
+ size_t opcode_size; |
+ NaClPcAddress pc_address = (NaClPcAddress) xed_decoder._pc_address; |
+ printf(" XED: %"NACL_PRIxNaClPcAddressAll": ", pc_address); |
+ |
+ /* Since xed doesn't print out opcode sequence, and it is |
+ * useful to know, add it to the print out. Note: Use same |
+ * spacing scheme as nacl decoder, so things line up. |
+ */ |
+ size_t num_bytes = MAX_INST_LENGTH; |
+ if (enumerator->_num_bytes > num_bytes) |
+ num_bytes = enumerator->_num_bytes; |
+ for (i = 0; i < num_bytes; ++i) { |
+ if (i < xed_decoder._xedd._decoded_length) { |
+ printf("%02x ", enumerator->_itext[i]); |
} else { |
- printf("%s\n", Disassemble(enumerator)); |
+ printf(" "); |
} |
} |
+ printf("%s\n", Disassemble(enumerator)); |
} |
static size_t InstLength(NaClEnumerator* enumerator) { |
@@ -242,10 +229,6 @@ |
#error("Bad NACL_TARGET_SUBARCH") |
#endif |
-static const char* Usage() { |
- return "Runs xed to decode instructions."; |
-} |
- |
static void InstallFlag(NaClEnumerator* enumerator, |
const char* flag_name, |
void* flag_address) { |
@@ -257,8 +240,6 @@ |
NaClEnumeratorDecoder* RegisterXedDecoder() { |
XedSetup(); |
xed_decoder._base._id_name = "xed"; |
- xed_decoder._base._legal_only = TRUE; |
- xed_decoder._base._print_only = FALSE; |
xed_decoder._base._parse_inst_fn = ParseInst; |
xed_decoder._base._inst_length_fn = InstLength; |
xed_decoder._base._print_inst_fn = PrintInst; |