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 #ifndef DWARF_READER_DWARF_INFO_PARSER_H_ | |
6 #define DWARF_READER_DWARF_INFO_PARSER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "common/dwarf/dwarf2reader.h" | |
11 | |
12 namespace dwarf_reader { | |
13 | |
14 class IDwarfReader; | |
15 class ParseState; | |
16 | |
17 /// The type this class inherits from is defined in breakpad. The functions | |
18 /// in this class get called as breakpad parses the DWARF information from the | |
19 /// binary file that is being debugged. This particular implementation fowards | |
20 /// the calls to a DWARF reader class, which can be written separately. | |
21 /// For detailed documentation on each function's expected behavior, please see | |
22 /// breakpad\dwarf2reader.h | |
23 class DwarfInfoParser : public dwarf2reader::Dwarf2Handler { | |
24 public: | |
25 DwarfInfoParser(ParseState *parse_state, IDwarfReader *reader); | |
26 | |
27 // Start to process a compilation unit at OFFSET from the beginning of the | |
28 // .debug_info section. Return false if you would like to skip this | |
29 // compilation unit. | |
30 virtual bool StartCompilationUnit(uint64 offset, | |
31 uint8 address_size, | |
32 uint8 offset_size, | |
33 uint64 compilation_unit_length, | |
34 uint8 dwarf_version); | |
35 | |
36 virtual bool StartDIE(uint64 offset, | |
37 enum dwarf2reader::DwarfTag tag, | |
38 const dwarf2reader::AttributeList& attributes); | |
39 | |
40 virtual void EndDIE(uint64 offset); | |
41 | |
42 virtual void ProcessAttributeUnsigned( | |
43 uint64 offset, | |
44 enum dwarf2reader::DwarfAttribute attribute, | |
45 enum dwarf2reader::DwarfForm form, uint64 data); | |
46 | |
47 virtual void ProcessAttributeSigned( | |
48 uint64 offset, | |
49 enum dwarf2reader::DwarfAttribute attribute, | |
50 enum dwarf2reader::DwarfForm form, | |
51 int64 data); | |
52 | |
53 virtual void ProcessAttributeReference( | |
54 uint64 offset, | |
55 enum dwarf2reader::DwarfAttribute attribute, | |
56 enum dwarf2reader::DwarfForm form, | |
57 uint64 data); | |
58 | |
59 virtual void ProcessAttributeBuffer( | |
60 uint64 offset, | |
61 enum dwarf2reader::DwarfAttribute attribute, | |
62 enum dwarf2reader::DwarfForm form, | |
63 const char* data, | |
64 uint64 len); | |
65 | |
66 virtual void ProcessAttributeString( | |
67 uint64 offset, | |
68 enum dwarf2reader::DwarfAttribute attribute, | |
69 enum dwarf2reader::DwarfForm form, | |
70 const std::string& data); | |
71 | |
72 private: | |
73 ParseState *parse_state_; | |
74 IDwarfReader *reader_; | |
75 }; | |
76 | |
77 } // namespace dwarf_reader | |
78 | |
79 #endif // DWARF_READER_DWARF_INFO_PARSER_H_ | |
OLD | NEW |