OLD | NEW |
1 // -*- mode: c++ -*- | 1 // -*- mode: c++ -*- |
2 | 2 |
3 // Copyright (c) 2011, Google Inc. | 3 // Copyright (c) 2011, 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 if (object_files_.size() > 0) | 105 if (object_files_.size() > 0) |
106 return &object_files_[0]; | 106 return &object_files_[0]; |
107 return NULL; | 107 return NULL; |
108 } | 108 } |
109 | 109 |
110 // Read the selected object file's debugging information, and write it out to | 110 // Read the selected object file's debugging information, and write it out to |
111 // |stream|. Return true on success; if an error occurs, report it and | 111 // |stream|. Return true on success; if an error occurs, report it and |
112 // return false. | 112 // return false. |
113 bool WriteSymbolFile(std::ostream &stream); | 113 bool WriteSymbolFile(std::ostream &stream); |
114 | 114 |
| 115 // Read the selected object file's debugging information, and write out the |
| 116 // header only to |stream|. Return true on success; if an error occurs, report |
| 117 // it and return false. |
| 118 bool WriteSymbolFileHeader(std::ostream &stream); |
| 119 |
115 // As above, but simply return the debugging information in module | 120 // As above, but simply return the debugging information in module |
116 // instead of writing it to a stream. The caller owns the resulting | 121 // instead of writing it to a stream. The caller owns the resulting |
117 // module object and must delete it when finished. | 122 // module object and must delete it when finished. |
118 bool ReadSymbolData(Module** module); | 123 bool ReadSymbolData(Module** module); |
119 | 124 |
120 private: | 125 private: |
121 // Used internally. | 126 // Used internally. |
122 class DumperLineToModule; | 127 class DumperLineToModule; |
123 class LoadCommandDumper; | 128 class LoadCommandDumper; |
124 | 129 |
125 // This method behaves similarly to NXFindBestFatArch, but it supports | 130 // This method behaves similarly to NXFindBestFatArch, but it supports |
126 // SuperFatArch. | 131 // SuperFatArch. |
127 SuperFatArch* FindBestMatchForArchitecture( | 132 SuperFatArch* FindBestMatchForArchitecture( |
128 cpu_type_t cpu_type, cpu_subtype_t cpu_subtype); | 133 cpu_type_t cpu_type, cpu_subtype_t cpu_subtype); |
129 | 134 |
130 // Return an identifier string for the file this DumpSymbols is dumping. | 135 // Return an identifier string for the file this DumpSymbols is dumping. |
131 std::string Identifier(); | 136 std::string Identifier(); |
132 | 137 |
| 138 |
| 139 // Creates an empty module object. |
| 140 bool CreateEmptyModule(scoped_ptr<Module>& module); |
| 141 |
133 // Read debugging information from |dwarf_sections|, which was taken from | 142 // Read debugging information from |dwarf_sections|, which was taken from |
134 // |macho_reader|, and add it to |module|. On success, return true; | 143 // |macho_reader|, and add it to |module|. On success, return true; |
135 // on failure, report the problem and return false. | 144 // on failure, report the problem and return false. |
136 bool ReadDwarf(google_breakpad::Module *module, | 145 bool ReadDwarf(google_breakpad::Module *module, |
137 const mach_o::Reader &macho_reader, | 146 const mach_o::Reader &macho_reader, |
138 const mach_o::SectionMap &dwarf_sections, | 147 const mach_o::SectionMap &dwarf_sections, |
139 bool handle_inter_cu_refs) const; | 148 bool handle_inter_cu_refs) const; |
140 | 149 |
141 // Read DWARF CFI or .eh_frame data from |section|, belonging to | 150 // Read DWARF CFI or .eh_frame data from |section|, belonging to |
142 // |macho_reader|, and record it in |module|. If |eh_frame| is true, | 151 // |macho_reader|, and record it in |module|. If |eh_frame| is true, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 const SuperFatArch *selected_object_file_; | 187 const SuperFatArch *selected_object_file_; |
179 | 188 |
180 // A string that identifies the selected object file, for use in error | 189 // A string that identifies the selected object file, for use in error |
181 // messages. This is usually object_filename_, but if that refers to a | 190 // messages. This is usually object_filename_, but if that refers to a |
182 // fat binary, it includes an indication of the particular architecture | 191 // fat binary, it includes an indication of the particular architecture |
183 // within that binary. | 192 // within that binary. |
184 string selected_object_name_; | 193 string selected_object_name_; |
185 }; | 194 }; |
186 | 195 |
187 } // namespace google_breakpad | 196 } // namespace google_breakpad |
OLD | NEW |