OLD | NEW |
1 // -*- mode: c++ -*- | 1 // -*- mode: c++ -*- |
2 | 2 |
3 // Copyright (c) 2010 Google Inc. | 3 // Copyright (c) 2010 Google Inc. |
4 // All rights reserved. | 4 // All rights reserved. |
5 // | 5 // |
6 // Redistribution and use in source and binary forms, with or without | 6 // Redistribution and use in source and binary forms, with or without |
7 // modification, are permitted provided that the following conditions are | 7 // modification, are permitted provided that the following conditions are |
8 // met: | 8 // met: |
9 // | 9 // |
10 // * Redistributions of source code must retain the above copyright | 10 // * Redistributions of source code must retain the above copyright |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // to true to handle debugging symbols with DW_FORM_ref_addr entries. | 77 // to true to handle debugging symbols with DW_FORM_ref_addr entries. |
78 class FileContext { | 78 class FileContext { |
79 public: | 79 public: |
80 FileContext(const string &filename, | 80 FileContext(const string &filename, |
81 Module *module, | 81 Module *module, |
82 bool handle_inter_cu_refs); | 82 bool handle_inter_cu_refs); |
83 ~FileContext(); | 83 ~FileContext(); |
84 | 84 |
85 // Add CONTENTS of size LENGTH to the section map as NAME. | 85 // Add CONTENTS of size LENGTH to the section map as NAME. |
86 void AddSectionToSectionMap(const string& name, | 86 void AddSectionToSectionMap(const string& name, |
87 const char* contents, | 87 const uint8_t *contents, |
88 uint64 length); | 88 uint64 length); |
89 | 89 |
90 // Clear the section map for testing. | 90 // Clear the section map for testing. |
91 void ClearSectionMapForTest(); | 91 void ClearSectionMapForTest(); |
92 | 92 |
93 const dwarf2reader::SectionMap& section_map() const; | 93 const dwarf2reader::SectionMap& section_map() const; |
94 | 94 |
95 private: | 95 private: |
96 friend class DwarfCUToModule; | 96 friend class DwarfCUToModule; |
97 | 97 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // Called at the beginning of a new compilation unit, prior to calling | 133 // Called at the beginning of a new compilation unit, prior to calling |
134 // ReadProgram(). compilation_dir will indicate the path that the | 134 // ReadProgram(). compilation_dir will indicate the path that the |
135 // current compilation unit was compiled in, consistent with the | 135 // current compilation unit was compiled in, consistent with the |
136 // DW_AT_comp_dir DIE. | 136 // DW_AT_comp_dir DIE. |
137 virtual void StartCompilationUnit(const string& compilation_dir) = 0; | 137 virtual void StartCompilationUnit(const string& compilation_dir) = 0; |
138 | 138 |
139 // Populate MODULE and LINES with source file names and code/line | 139 // Populate MODULE and LINES with source file names and code/line |
140 // mappings, given a pointer to some DWARF line number data | 140 // mappings, given a pointer to some DWARF line number data |
141 // PROGRAM, and an overestimate of its size. Add no zero-length | 141 // PROGRAM, and an overestimate of its size. Add no zero-length |
142 // lines to LINES. | 142 // lines to LINES. |
143 virtual void ReadProgram(const char *program, uint64 length, | 143 virtual void ReadProgram(const uint8_t *program, uint64 length, |
144 Module *module, vector<Module::Line> *lines) = 0; | 144 Module *module, vector<Module::Line> *lines) = 0; |
145 }; | 145 }; |
146 | 146 |
147 // The interface DwarfCUToModule uses to report warnings. The member | 147 // The interface DwarfCUToModule uses to report warnings. The member |
148 // function definitions for this class write messages to stderr, but | 148 // function definitions for this class write messages to stderr, but |
149 // you can override them if you'd like to detect or report these | 149 // you can override them if you'd like to detect or report these |
150 // conditions yourself. | 150 // conditions yourself. |
151 class WarningReporter { | 151 class WarningReporter { |
152 public: | 152 public: |
153 // Warn about problems in the DWARF file FILENAME, in the | 153 // Warn about problems in the DWARF file FILENAME, in the |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 309 |
310 // The line numbers we have seen thus far. We accumulate these here | 310 // The line numbers we have seen thus far. We accumulate these here |
311 // during parsing. Then, in Finish, we call AssignLinesToFunctions | 311 // during parsing. Then, in Finish, we call AssignLinesToFunctions |
312 // to dole them out to the appropriate functions. | 312 // to dole them out to the appropriate functions. |
313 vector<Module::Line> lines_; | 313 vector<Module::Line> lines_; |
314 }; | 314 }; |
315 | 315 |
316 } // namespace google_breakpad | 316 } // namespace google_breakpad |
317 | 317 |
318 #endif // COMMON_LINUX_DWARF_CU_TO_MODULE_H__ | 318 #endif // COMMON_LINUX_DWARF_CU_TO_MODULE_H__ |
OLD | NEW |