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

Unified Diff: src/trusted/validator/x86/testing/enuminsts/enuminsts.h

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/enuminsts.h
===================================================================
--- src/trusted/validator/x86/testing/enuminsts/enuminsts.h (revision 8119)
+++ src/trusted/validator/x86/testing/enuminsts/enuminsts.h (working copy)
@@ -17,14 +17,22 @@
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/shared/utils/types.h"
+/* Defines routine to print out non-fatal error due to unexpected
+ * internal error.
+ */
+extern void InternalError(const char *why);
+
+/* Records that a fatal (i.e. non-recoverable) error occurred. */
+extern void ReportFatalError(const char* why);
+
/* Structure holding decoder/validation tool to test. */
struct NaClEnumeratorDecoder;
/* Defines the maximum length of an instruction. */
-#define NACL_ENUM_MAX_INSTRUCTION_BYTES 30
+#define NACL_ENUM_MAX_INSTRUCTION_BYTES 15
/* Defines the maximum number of enumeration decoders one can run. */
-#define NACL_MAX_ENUM_DECODERS 2
+#define NACL_MAX_ENUM_DECODERS 5
/*
* Defines the data structure used by the driver to enumerate possible
@@ -43,16 +51,6 @@
/* Defines the number of decoders being applied. */
size_t _num_decoders;
-
- /* Defines flag defining if only opcode bytes should be printed. */
- Bool _print_opcode_bytes_only;
-
- /*
- * Returns true if the enumerated instruction should be printed out in
- * a easily to read form. That is, the sequence of opcodes,
- * followed by "#", followed by the instruction text.
- */
- Bool _print_enumerated_instruction;
} NaClEnumerator;
/* Define the (virtual) function to parse the first instruction in the itext
@@ -151,10 +149,27 @@
/* True if the legal filter should be applied to this tester. That is,
* only report on instructions this tester finds to be a legal instruction.
* When false, filter out instructions that are illegal.
+ * Note: This field is initialized by NaClPreregisterEnumeratorDecoder
+ * in enuminsts.c
*/
Bool _legal_only;
- /* True if we should should not run comparison tests, but only print. */
- Bool _print_only;
+ /* True if we should should not run comparison tests, but only print.
+ * Note: This field is initialized by NaClPreregisterEnumeratorDecoder
+ * in enuminsts.c
+ */
+ Bool _print;
+ /* True if we should print out the matched opcode sequence for the decoder.
+ * Note: This field is initialized by NaClPreregisterEnumeratorDecoder
+ * in enuminsts.c
+ */
+ Bool _print_opcode_sequence;
+ /* True if we should print out the matched opcode sequence, as well as the
+ * mnemonic and operands (as returned by _get_inst_mnemonic_fn and
+ * _get_inst_operands_text_fn) as a comment after the matched opcode sequence.
+ * Note: This field is initialized by NaClPreregisterEnumeratorDecoder
+ * in enuminsts.c
+ */
+ Bool _print_opcode_sequence_plus_desc;
/*
* Parses the first instruction in the itext array of the enumerator. Assumes
* that the length of the first instruction must be <= the _num_bytes field

Powered by Google App Engine
This is Rietveld 408576698