OLD | NEW |
1 // Copyright (c) 2011 Google Inc. | 1 // Copyright (c) 2011 Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include <utility> | 42 #include <utility> |
43 | 43 |
44 namespace google_breakpad { | 44 namespace google_breakpad { |
45 | 45 |
46 using std::dec; | 46 using std::dec; |
47 using std::endl; | 47 using std::endl; |
48 using std::hex; | 48 using std::hex; |
49 | 49 |
50 | 50 |
51 Module::Module(const string &name, const string &os, | 51 Module::Module(const string &name, const string &os, |
52 const string &architecture, const string &id) : | 52 const string &architecture, const string &id, |
| 53 const string &code_id /* = "" */) : |
53 name_(name), | 54 name_(name), |
54 os_(os), | 55 os_(os), |
55 architecture_(architecture), | 56 architecture_(architecture), |
56 id_(id), | 57 id_(id), |
| 58 code_id_(code_id), |
57 load_address_(0) { } | 59 load_address_(0) { } |
58 | 60 |
59 Module::~Module() { | 61 Module::~Module() { |
60 for (FileByNameMap::iterator it = files_.begin(); it != files_.end(); ++it) | 62 for (FileByNameMap::iterator it = files_.begin(); it != files_.end(); ++it) |
61 delete it->second; | 63 delete it->second; |
62 for (FunctionSet::iterator it = functions_.begin(); | 64 for (FunctionSet::iterator it = functions_.begin(); |
63 it != functions_.end(); ++it) { | 65 it != functions_.end(); ++it) { |
64 delete *it; | 66 delete *it; |
65 } | 67 } |
66 for (vector<StackFrameEntry *>::iterator it = stack_frame_entries_.begin(); | 68 for (vector<StackFrameEntry *>::iterator it = stack_frame_entries_.begin(); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 } | 230 } |
229 return stream.good(); | 231 return stream.good(); |
230 } | 232 } |
231 | 233 |
232 bool Module::Write(std::ostream &stream, SymbolData symbol_data) { | 234 bool Module::Write(std::ostream &stream, SymbolData symbol_data) { |
233 stream << "MODULE " << os_ << " " << architecture_ << " " | 235 stream << "MODULE " << os_ << " " << architecture_ << " " |
234 << id_ << " " << name_ << endl; | 236 << id_ << " " << name_ << endl; |
235 if (!stream.good()) | 237 if (!stream.good()) |
236 return ReportError(); | 238 return ReportError(); |
237 | 239 |
| 240 if (!code_id_.empty()) { |
| 241 stream << "INFO CODE_ID " << code_id_ << endl; |
| 242 } |
| 243 |
238 if (symbol_data != ONLY_CFI) { | 244 if (symbol_data != ONLY_CFI) { |
239 AssignSourceIds(); | 245 AssignSourceIds(); |
240 | 246 |
241 // Write out files. | 247 // Write out files. |
242 for (FileByNameMap::iterator file_it = files_.begin(); | 248 for (FileByNameMap::iterator file_it = files_.begin(); |
243 file_it != files_.end(); ++file_it) { | 249 file_it != files_.end(); ++file_it) { |
244 File *file = file_it->second; | 250 File *file = file_it->second; |
245 if (file->source_id >= 0) { | 251 if (file->source_id >= 0) { |
246 stream << "FILE " << file->source_id << " " << file->name << endl; | 252 stream << "FILE " << file->source_id << " " << file->name << endl; |
247 if (!stream.good()) | 253 if (!stream.good()) |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 | 316 |
311 stream << endl; | 317 stream << endl; |
312 } | 318 } |
313 } | 319 } |
314 } | 320 } |
315 | 321 |
316 return true; | 322 return true; |
317 } | 323 } |
318 | 324 |
319 } // namespace google_breakpad | 325 } // namespace google_breakpad |
OLD | NEW |