2 * Copyright (c) 2011 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
9 * Validate x86 instructions for Native Client
13 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/ncvalidate_iter.h"
15 #include "native_client/src/shared/platform/nacl_log.h"
16 #include "native_client/src/trusted/validator/x86/decoder/nc_inst_state_internal.h"
17 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/ncvalidate_iter_internal.h"
19 void NaClValidatorStateSetErrorReporter(NaClValidatorState *state,
20 NaClErrorReporter *reporter) {
21 switch (reporter->supported_reporter) {
22 case NaClNullErrorReporter:
23 case NaClInstStateErrorReporter:
24 state->error_reporter = reporter;
31 "*** FATAL: using unsupported error reporter! ***\n",
32 "*** NaClInstStateErrorReporter expected but found %s ***\n",
33 NaClErrorReporterSupportedName(reporter->supported_reporter));
37 static void NaClVerboseErrorPrintInst(NaClErrorReporter* self,
38 struct NaClInstState* inst) {
39 NaClInstStateInstPrint(NaClLogGetGio(), inst);
42 NaClErrorReporter kNaClVerboseErrorReporter = {
43 NaClInstStateErrorReporter,
44 NaClVerboseErrorPrintf,
45 NaClVerboseErrorPrintfV,
46 (NaClPrintInst) NaClVerboseErrorPrintInst