OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Native Client Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // This file defines the ElfObject which decodes the elf data and calls | |
6 // the appropriate reader callbacks. The reader interface allows the | |
7 // libary user to examine the ELF file without ever needing to know | |
8 // machine class (32/64 bit). | |
9 | |
10 #ifndef DWARF_READER_DWARF_PARSE_H_ | |
11 #define DWARF_READER_DWARF_PARSE_H_ | |
12 | |
13 #include "common/types.h" | |
14 | |
15 namespace elf_reader { | |
16 class ElfObject; | |
17 } // namespace elf_reader | |
18 | |
19 namespace dwarf_reader { | |
20 | |
21 class IDwarfReader; | |
22 class IDwarfVM; | |
23 | |
24 /// Populates an IDwarfReader with debug information. | |
25 /// @param elf An ElfObject, which should be preloaded with a binary file | |
26 /// location. | |
27 /// @param reader An IDwarfReader which needs to be populated. | |
28 void DwarfParseElf(elf_reader::ElfObject *elf, IDwarfReader *reader); | |
29 | |
30 /// Runs the IDwarfVM on the provided data. |data| is expected to be a dwarf | |
31 /// expression in binary format of length |length| | |
32 /// @param dwarf_state_machine The state machine which must implement | |
33 /// IDwarfVM. | |
34 /// @param data The dwarf expression. | |
35 /// @param length The length of the dwarf expression. | |
36 /// @return The result of the expression. | |
37 uint64_t DwarfParseVM(IDwarfVM *dwarf_state_machine, | |
38 uint8_t *data, | |
39 uint32_t length); | |
40 | |
41 } // namespace dwarf_reader | |
42 | |
43 #endif // DWARF_READER_DWARF_PARSE_H_ | |
44 | |
OLD | NEW |