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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 it != dwarf_sections.end(); ++it) { | 270 it != dwarf_sections.end(); ++it) { |
271 file_context.AddSectionToSectionMap( | 271 file_context.AddSectionToSectionMap( |
272 it->first, | 272 it->first, |
273 reinterpret_cast<const char *>(it->second.contents.start), | 273 reinterpret_cast<const char *>(it->second.contents.start), |
274 it->second.contents.Size()); | 274 it->second.contents.Size()); |
275 } | 275 } |
276 | 276 |
277 // Find the __debug_info section. | 277 // Find the __debug_info section. |
278 dwarf2reader::SectionMap::const_iterator debug_info_entry = | 278 dwarf2reader::SectionMap::const_iterator debug_info_entry = |
279 file_context.section_map().find("__debug_info"); | 279 file_context.section_map().find("__debug_info"); |
280 assert(debug_info_entry != file_context.section_map().end()); | 280 if (debug_info_entry == file_context.section_map().end()) { |
| 281 fprintf(stderr, "%s: __DWARF segment of file has no __debug_info section\n", |
| 282 selected_object_name_.c_str()); |
| 283 return false; |
| 284 } |
| 285 |
281 const std::pair<const char*, uint64>& debug_info_section = | 286 const std::pair<const char*, uint64>& debug_info_section = |
282 debug_info_entry->second; | 287 debug_info_entry->second; |
283 // There had better be a __debug_info section! | 288 // There had better be a __debug_info section! |
284 if (!debug_info_section.first) { | 289 if (!debug_info_section.first) { |
285 fprintf(stderr, "%s: __DWARF segment of file has no __debug_info section\n", | 290 fprintf(stderr, "%s: __DWARF segment of file has no __debug_info section\n", |
286 selected_object_name_.c_str()); | 291 selected_object_name_.c_str()); |
287 return false; | 292 return false; |
288 } | 293 } |
289 | 294 |
290 // Build a line-to-module loader for the root handler to use. | 295 // Build a line-to-module loader for the root handler to use. |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 if (ReadSymbolData(&module) && module) { | 542 if (ReadSymbolData(&module) && module) { |
538 bool res = module->Write(stream, symbol_data_); | 543 bool res = module->Write(stream, symbol_data_); |
539 delete module; | 544 delete module; |
540 return res; | 545 return res; |
541 } | 546 } |
542 | 547 |
543 return false; | 548 return false; |
544 } | 549 } |
545 | 550 |
546 } // namespace google_breakpad | 551 } // namespace google_breakpad |
OLD | NEW |