Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: src/trusted/validator/x86/testing/enuminsts/xed_tester.c

Issue 9861030: Modify enuminsts to be able to communicate matched instructions accross (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698