Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: src/processor/minidump.cc

Issue 1939333002: Write adjusted range back to module (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad/src.git@master
Patch Set: address comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/google_breakpad/processor/minidump.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
2330 2337
2331 void MinidumpModule::Print() { 2338 void MinidumpModule::Print() {
2332 if (!valid_) { 2339 if (!valid_) {
2333 BPLOG(ERROR) << "MinidumpModule cannot print invalid data"; 2340 BPLOG(ERROR) << "MinidumpModule cannot print invalid data";
2334 return; 2341 return;
2335 } 2342 }
2336 2343
2337 printf("MDRawModule\n"); 2344 printf("MDRawModule\n");
2338 printf(" base_of_image = 0x%" PRIx64 "\n", 2345 printf(" base_of_image = 0x%" PRIx64 "\n",
2339 module_.base_of_image); 2346 module_.base_of_image);
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
2628 base_address = last_end_address; 2635 base_address = last_end_address;
2629 if (!range_map_->StoreRange(base_address, 2636 if (!range_map_->StoreRange(base_address,
2630 module_size, module_index)) { 2637 module_size, module_index)) {
2631 BPLOG(ERROR) << "MinidumpModuleList could not store module " << 2638 BPLOG(ERROR) << "MinidumpModuleList could not store module " <<
2632 module_index << "/" << module_count << ", " << 2639 module_index << "/" << module_count << ", " <<
2633 module->code_file() << ", " << 2640 module->code_file() << ", " <<
2634 HexString(base_address) << "+" << 2641 HexString(base_address) << "+" <<
2635 HexString(module_size) << ", after adjusting"; 2642 HexString(module_size) << ", after adjusting";
2636 return false; 2643 return false;
2637 } 2644 }
2645 module->set_base_address_and_size(base_address, module_size);
2638 } else { 2646 } else {
2639 BPLOG(ERROR) << "MinidumpModuleList could not store module " << 2647 BPLOG(ERROR) << "MinidumpModuleList could not store module " <<
2640 module_index << "/" << module_count << ", " << 2648 module_index << "/" << module_count << ", " <<
2641 module->code_file() << ", " << 2649 module->code_file() << ", " <<
2642 HexString(base_address) << "+" << 2650 HexString(base_address) << "+" <<
2643 HexString(module_size); 2651 HexString(module_size);
2644 return false; 2652 return false;
2645 } 2653 }
2646 } else { 2654 } else {
2647 BPLOG(INFO) << "MinidumpModuleList ignoring overlapping module " << 2655 BPLOG(INFO) << "MinidumpModuleList ignoring overlapping module " <<
(...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after
4865 return NULL; 4873 return NULL;
4866 } 4874 }
4867 4875
4868 *stream = new_stream.release(); 4876 *stream = new_stream.release();
4869 info->stream = *stream; 4877 info->stream = *stream;
4870 return *stream; 4878 return *stream;
4871 } 4879 }
4872 4880
4873 4881
4874 } // namespace google_breakpad 4882 } // namespace google_breakpad
OLDNEW
« no previous file with comments | « src/google_breakpad/processor/minidump.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698