Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 Google Inc. | 1 // Copyright (c) 2010 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 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2102 // Mac OS X and Linux, instead of forcing them to adhere to the dotted | 2102 // Mac OS X and Linux, instead of forcing them to adhere to the dotted |
| 2103 // quad of 16-bit ints that Windows uses. | 2103 // quad of 16-bit ints that Windows uses. |
| 2104 | 2104 |
| 2105 BPLOG_IF(INFO, version.empty()) << "MinidumpModule could not determine " | 2105 BPLOG_IF(INFO, version.empty()) << "MinidumpModule could not determine " |
| 2106 "version for " << *name_; | 2106 "version for " << *name_; |
| 2107 | 2107 |
| 2108 return version; | 2108 return version; |
| 2109 } | 2109 } |
| 2110 | 2110 |
| 2111 | 2111 |
| 2112 const CodeModule* MinidumpModule::Copy() const { | 2112 CodeModule* MinidumpModule::Copy() const { |
| 2113 return new BasicCodeModule(this); | 2113 return new BasicCodeModule(this); |
| 2114 } | 2114 } |
| 2115 | 2115 |
| 2116 | 2116 |
| 2117 uint64_t MinidumpModule::shrink_down_delta() const { | |
| 2118 return 0; | |
| 2119 } | |
| 2120 | |
| 2121 void MinidumpModule::SetShrinkDownDelta(uint64_t shrink_down_delta) { | |
| 2122 // Not implemented | |
| 2123 assert(false); | |
| 2124 } | |
| 2125 | |
| 2126 | |
| 2117 const uint8_t* MinidumpModule::GetCVRecord(uint32_t* size) { | 2127 const uint8_t* MinidumpModule::GetCVRecord(uint32_t* size) { |
| 2118 if (!module_valid_) { | 2128 if (!module_valid_) { |
| 2119 BPLOG(ERROR) << "Invalid MinidumpModule for GetCVRecord"; | 2129 BPLOG(ERROR) << "Invalid MinidumpModule for GetCVRecord"; |
| 2120 return NULL; | 2130 return NULL; |
| 2121 } | 2131 } |
| 2122 | 2132 |
| 2123 if (!cv_record_) { | 2133 if (!cv_record_) { |
| 2124 // This just guards against 0-sized CodeView records; more specific checks | 2134 // This just guards against 0-sized CodeView records; more specific checks |
| 2125 // are used when the signature is checked against various structure types. | 2135 // are used when the signature is checked against various structure types. |
| 2126 if (module_.cv_record.data_size == 0) { | 2136 if (module_.cv_record.data_size == 0) { |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2490 | 2500 |
| 2491 | 2501 |
| 2492 uint32_t MinidumpModuleList::max_modules_ = 1024; | 2502 uint32_t MinidumpModuleList::max_modules_ = 1024; |
| 2493 | 2503 |
| 2494 | 2504 |
| 2495 MinidumpModuleList::MinidumpModuleList(Minidump* minidump) | 2505 MinidumpModuleList::MinidumpModuleList(Minidump* minidump) |
| 2496 : MinidumpStream(minidump), | 2506 : MinidumpStream(minidump), |
| 2497 range_map_(new RangeMap<uint64_t, unsigned int>()), | 2507 range_map_(new RangeMap<uint64_t, unsigned int>()), |
| 2498 modules_(NULL), | 2508 modules_(NULL), |
| 2499 module_count_(0) { | 2509 module_count_(0) { |
| 2510 range_map_->SetEnableShrinkDown(true); | |
|
Mark Mentovai
2016/06/13 14:38:10
I thought that we were only going to do this for t
ivanpe
2016/06/13 21:36:00
I thought about this. I'm sorry I didn't mentione
| |
| 2500 } | 2511 } |
| 2501 | 2512 |
| 2502 | 2513 |
| 2503 MinidumpModuleList::~MinidumpModuleList() { | 2514 MinidumpModuleList::~MinidumpModuleList() { |
| 2504 delete range_map_; | 2515 delete range_map_; |
| 2505 delete modules_; | 2516 delete modules_; |
| 2506 } | 2517 } |
| 2507 | 2518 |
| 2508 | 2519 |
| 2509 bool MinidumpModuleList::Read(uint32_t expected_size) { | 2520 bool MinidumpModuleList::Read(uint32_t expected_size) { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2702 return NULL; | 2713 return NULL; |
| 2703 } | 2714 } |
| 2704 | 2715 |
| 2705 if (sequence >= module_count_) { | 2716 if (sequence >= module_count_) { |
| 2706 BPLOG(ERROR) << "MinidumpModuleList sequence out of range: " << | 2717 BPLOG(ERROR) << "MinidumpModuleList sequence out of range: " << |
| 2707 sequence << "/" << module_count_; | 2718 sequence << "/" << module_count_; |
| 2708 return NULL; | 2719 return NULL; |
| 2709 } | 2720 } |
| 2710 | 2721 |
| 2711 unsigned int module_index; | 2722 unsigned int module_index; |
| 2712 if (!range_map_->RetrieveRangeAtIndex(sequence, &module_index, | 2723 if (!range_map_->RetrieveRangeAtIndex(sequence, &module_index, |
| 2713 NULL /* base */, NULL /* delta */, | 2724 NULL /* base */, NULL /* delta */, |
| 2714 NULL /* size */)) { | 2725 NULL /* size */)) { |
| 2715 BPLOG(ERROR) << "MinidumpModuleList has no module at sequence " << sequence; | 2726 BPLOG(ERROR) << "MinidumpModuleList has no module at sequence " << sequence; |
| 2716 return NULL; | 2727 return NULL; |
| 2717 } | 2728 } |
| 2718 | 2729 |
| 2719 return GetModuleAtIndex(module_index); | 2730 return GetModuleAtIndex(module_index); |
| 2720 } | 2731 } |
| 2721 | 2732 |
| 2722 | 2733 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 2734 } | 2745 } |
| 2735 | 2746 |
| 2736 return &(*modules_)[index]; | 2747 return &(*modules_)[index]; |
| 2737 } | 2748 } |
| 2738 | 2749 |
| 2739 | 2750 |
| 2740 const CodeModules* MinidumpModuleList::Copy() const { | 2751 const CodeModules* MinidumpModuleList::Copy() const { |
| 2741 return new BasicCodeModules(this); | 2752 return new BasicCodeModules(this); |
| 2742 } | 2753 } |
| 2743 | 2754 |
| 2755 vector<linked_ptr<const CodeModule> > | |
| 2756 MinidumpModuleList::GetShrunkRangeModules() const { | |
| 2757 return vector<linked_ptr<const CodeModule> >(); | |
| 2758 } | |
| 2744 | 2759 |
| 2745 void MinidumpModuleList::Print() { | 2760 void MinidumpModuleList::Print() { |
| 2746 if (!valid_) { | 2761 if (!valid_) { |
| 2747 BPLOG(ERROR) << "MinidumpModuleList cannot print invalid data"; | 2762 BPLOG(ERROR) << "MinidumpModuleList cannot print invalid data"; |
| 2748 return; | 2763 return; |
| 2749 } | 2764 } |
| 2750 | 2765 |
| 2751 printf("MinidumpModuleList\n"); | 2766 printf("MinidumpModuleList\n"); |
| 2752 printf(" module_count = %d\n", module_count_); | 2767 printf(" module_count = %d\n", module_count_); |
| 2753 printf("\n"); | 2768 printf("\n"); |
| (...skipping 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4870 return NULL; | 4885 return NULL; |
| 4871 } | 4886 } |
| 4872 | 4887 |
| 4873 *stream = new_stream.release(); | 4888 *stream = new_stream.release(); |
| 4874 info->stream = *stream; | 4889 info->stream = *stream; |
| 4875 return *stream; | 4890 return *stream; |
| 4876 } | 4891 } |
| 4877 | 4892 |
| 4878 | 4893 |
| 4879 } // namespace google_breakpad | 4894 } // namespace google_breakpad |
| OLD | NEW |