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 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2320 // return it casted to MDImageDebugMisc*. | 2320 // return it casted to MDImageDebugMisc*. |
2321 misc_record_ = misc_record_mem.release(); | 2321 misc_record_ = misc_record_mem.release(); |
2322 } | 2322 } |
2323 | 2323 |
2324 if (size) | 2324 if (size) |
2325 *size = module_.misc_record.data_size; | 2325 *size = module_.misc_record.data_size; |
2326 | 2326 |
2327 return reinterpret_cast<MDImageDebugMisc*>(&(*misc_record_)[0]); | 2327 return reinterpret_cast<MDImageDebugMisc*>(&(*misc_record_)[0]); |
2328 } | 2328 } |
2329 | 2329 |
2330 void MinidumpModule::set_base_address_and_size(uint64_t base_address, | |
2331 uint64_t size) { | |
2332 if (valid_) { | |
2333 module_.base_of_image = base_address; | |
2334 module_.size_of_image = size; | |
2335 } | |
2336 } | |
2337 | 2330 |
2338 void MinidumpModule::Print() { | 2331 void MinidumpModule::Print() { |
2339 if (!valid_) { | 2332 if (!valid_) { |
2340 BPLOG(ERROR) << "MinidumpModule cannot print invalid data"; | 2333 BPLOG(ERROR) << "MinidumpModule cannot print invalid data"; |
2341 return; | 2334 return; |
2342 } | 2335 } |
2343 | 2336 |
2344 printf("MDRawModule\n"); | 2337 printf("MDRawModule\n"); |
2345 printf(" base_of_image = 0x%" PRIx64 "\n", | 2338 printf(" base_of_image = 0x%" PRIx64 "\n", |
2346 module_.base_of_image); | 2339 module_.base_of_image); |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2635 base_address = last_end_address; | 2628 base_address = last_end_address; |
2636 if (!range_map_->StoreRange(base_address, | 2629 if (!range_map_->StoreRange(base_address, |
2637 module_size, module_index)) { | 2630 module_size, module_index)) { |
2638 BPLOG(ERROR) << "MinidumpModuleList could not store module " << | 2631 BPLOG(ERROR) << "MinidumpModuleList could not store module " << |
2639 module_index << "/" << module_count << ", " << | 2632 module_index << "/" << module_count << ", " << |
2640 module->code_file() << ", " << | 2633 module->code_file() << ", " << |
2641 HexString(base_address) << "+" << | 2634 HexString(base_address) << "+" << |
2642 HexString(module_size) << ", after adjusting"; | 2635 HexString(module_size) << ", after adjusting"; |
2643 return false; | 2636 return false; |
2644 } | 2637 } |
2645 module->set_base_address_and_size(base_address, module_size); | |
2646 } else { | 2638 } else { |
2647 BPLOG(ERROR) << "MinidumpModuleList could not store module " << | 2639 BPLOG(ERROR) << "MinidumpModuleList could not store module " << |
2648 module_index << "/" << module_count << ", " << | 2640 module_index << "/" << module_count << ", " << |
2649 module->code_file() << ", " << | 2641 module->code_file() << ", " << |
2650 HexString(base_address) << "+" << | 2642 HexString(base_address) << "+" << |
2651 HexString(module_size); | 2643 HexString(module_size); |
2652 return false; | 2644 return false; |
2653 } | 2645 } |
2654 } else { | 2646 } else { |
2655 BPLOG(INFO) << "MinidumpModuleList ignoring overlapping module " << | 2647 BPLOG(INFO) << "MinidumpModuleList ignoring overlapping module " << |
(...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4873 return NULL; | 4865 return NULL; |
4874 } | 4866 } |
4875 | 4867 |
4876 *stream = new_stream.release(); | 4868 *stream = new_stream.release(); |
4877 info->stream = *stream; | 4869 info->stream = *stream; |
4878 return *stream; | 4870 return *stream; |
4879 } | 4871 } |
4880 | 4872 |
4881 | 4873 |
4882 } // namespace google_breakpad | 4874 } // namespace google_breakpad |
OLD | NEW |