OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (c) 2012 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. | |
5 */ | |
6 | |
7 /* | |
8 * ncdecode_verbose.h - Print routines for validator that are | |
9 * not to be loaded into sel_ldr. | |
10 */ | |
11 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_SEG_SFI_NCDECODE_VERBOSE_H
_ | |
12 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_SEG_SFI_NCDECODE_VERBOSE_H
_ | |
13 | |
14 #include <stdio.h> | |
15 #include "native_client/src/trusted/validator/x86/error_reporter.h" | |
16 #include "native_client/src/trusted/validator/types_memory_model.h" | |
17 | |
18 struct NCDecoderInst; | |
19 struct Gio; | |
20 | |
21 /* | |
22 * Run the decoder and print out the decoded instructions. | |
23 * Note: Prints to NaClLogGetGio(). | |
24 * | |
25 * Parameters are: | |
26 * mbase - The beging of the memory segment to decode. | |
27 * vbase - The (virtual) base address of the memory segment. | |
28 * sz - The number of bytes in the memory segment. | |
29 * vstate - validator state (or NULL) to use with callbacks. | |
30 */ | |
31 extern void NCDecodeSegment(uint8_t* mbase, NaClPcAddress vbase, | |
32 NaClMemorySize sz); | |
33 | |
34 /* Print out the instruction (including the sequence of disassembled | |
35 * hexidecimal bytes) to the given file. | |
36 */ | |
37 extern void NCPrintInstWithHex(const struct NCDecoderInst* inst, | |
38 struct Gio* file); | |
39 | |
40 /* Print out the instruction (excluding the sequence of disassembled | |
41 * hexidecimal bytes) to the given file. | |
42 */ | |
43 extern void NCPrintInstWithoutHex(const struct NCDecoderInst* inst, | |
44 struct Gio* file); | |
45 | |
46 /* Generate a (malloc allocated) string describing the instruction (including | |
47 * the sequence of disassembled hexidecimal bytes). | |
48 */ | |
49 extern char* NCInstWithHexToString(const struct NCDecoderInst* inst); | |
50 | |
51 /* Generate a (malloc allocated) string describing the instruction (excluding | |
52 * the sequence of disassembled hexidecimal bytes). | |
53 */ | |
54 extern char* NCInstWithoutHexToString(const struct NCDecoderInst* inst); | |
55 | |
56 /* Verbose error reporter for a NCDecoderInst* that reports to | |
57 * NaClLogGetGio(). | |
58 */ | |
59 extern NaClErrorReporter kNCVerboseErrorReporter; | |
60 | |
61 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_SEG_SFI_NCDECODE_VERBOS
E_H_ */ | |
OLD | NEW |