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

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

Issue 2029953003: Adding support for overlapping ranges to RangeMap. (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Addressing code review comments Created 4 years, 6 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
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 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after
2665 2665
2666 2666
2667 const MinidumpModule* MinidumpModuleList::GetModuleForAddress( 2667 const MinidumpModule* MinidumpModuleList::GetModuleForAddress(
2668 uint64_t address) const { 2668 uint64_t address) const {
2669 if (!valid_) { 2669 if (!valid_) {
2670 BPLOG(ERROR) << "Invalid MinidumpModuleList for GetModuleForAddress"; 2670 BPLOG(ERROR) << "Invalid MinidumpModuleList for GetModuleForAddress";
2671 return NULL; 2671 return NULL;
2672 } 2672 }
2673 2673
2674 unsigned int module_index; 2674 unsigned int module_index;
2675 if (!range_map_->RetrieveRange(address, &module_index, NULL, NULL)) { 2675 if (!range_map_->RetrieveRange(address, &module_index, NULL, NULL, NULL)) {
mmandlis 2016/06/02 23:50:59 nit - please, add comments for the NULL parameters
2676 BPLOG(INFO) << "MinidumpModuleList has no module at " << 2676 BPLOG(INFO) << "MinidumpModuleList has no module at " <<
2677 HexString(address); 2677 HexString(address);
2678 return NULL; 2678 return NULL;
2679 } 2679 }
2680 2680
2681 return GetModuleAtIndex(module_index); 2681 return GetModuleAtIndex(module_index);
2682 } 2682 }
2683 2683
2684 2684
2685 const MinidumpModule* MinidumpModuleList::GetMainModule() const { 2685 const MinidumpModule* MinidumpModuleList::GetMainModule() const {
(...skipping 15 matching lines...) Expand all
2701 return NULL; 2701 return NULL;
2702 } 2702 }
2703 2703
2704 if (sequence >= module_count_) { 2704 if (sequence >= module_count_) {
2705 BPLOG(ERROR) << "MinidumpModuleList sequence out of range: " << 2705 BPLOG(ERROR) << "MinidumpModuleList sequence out of range: " <<
2706 sequence << "/" << module_count_; 2706 sequence << "/" << module_count_;
2707 return NULL; 2707 return NULL;
2708 } 2708 }
2709 2709
2710 unsigned int module_index; 2710 unsigned int module_index;
2711 if (!range_map_->RetrieveRangeAtIndex(sequence, &module_index, NULL, NULL)) { 2711 if (!range_map_->RetrieveRangeAtIndex(sequence, &module_index, NULL, NULL,
2712 NULL)) {
2712 BPLOG(ERROR) << "MinidumpModuleList has no module at sequence " << sequence; 2713 BPLOG(ERROR) << "MinidumpModuleList has no module at sequence " << sequence;
2713 return NULL; 2714 return NULL;
2714 } 2715 }
2715 2716
2716 return GetModuleAtIndex(module_index); 2717 return GetModuleAtIndex(module_index);
2717 } 2718 }
2718 2719
2719 2720
2720 const MinidumpModule* MinidumpModuleList::GetModuleAtIndex( 2721 const MinidumpModule* MinidumpModuleList::GetModuleAtIndex(
2721 unsigned int index) const { 2722 unsigned int index) const {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
2916 2917
2917 2918
2918 MinidumpMemoryRegion* MinidumpMemoryList::GetMemoryRegionForAddress( 2919 MinidumpMemoryRegion* MinidumpMemoryList::GetMemoryRegionForAddress(
2919 uint64_t address) { 2920 uint64_t address) {
2920 if (!valid_) { 2921 if (!valid_) {
2921 BPLOG(ERROR) << "Invalid MinidumpMemoryList for GetMemoryRegionForAddress"; 2922 BPLOG(ERROR) << "Invalid MinidumpMemoryList for GetMemoryRegionForAddress";
2922 return NULL; 2923 return NULL;
2923 } 2924 }
2924 2925
2925 unsigned int region_index; 2926 unsigned int region_index;
2926 if (!range_map_->RetrieveRange(address, &region_index, NULL, NULL)) { 2927 if (!range_map_->RetrieveRange(address, &region_index, NULL, NULL, NULL)) {
2927 BPLOG(INFO) << "MinidumpMemoryList has no memory region at " << 2928 BPLOG(INFO) << "MinidumpMemoryList has no memory region at " <<
2928 HexString(address); 2929 HexString(address);
2929 return NULL; 2930 return NULL;
2930 } 2931 }
2931 2932
2932 return GetMemoryRegionAtIndex(region_index); 2933 return GetMemoryRegionAtIndex(region_index);
2933 } 2934 }
2934 2935
2935 2936
2936 void MinidumpMemoryList::Print() { 2937 void MinidumpMemoryList::Print() {
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
4020 4021
4021 const MinidumpMemoryInfo* MinidumpMemoryInfoList::GetMemoryInfoForAddress( 4022 const MinidumpMemoryInfo* MinidumpMemoryInfoList::GetMemoryInfoForAddress(
4022 uint64_t address) const { 4023 uint64_t address) const {
4023 if (!valid_) { 4024 if (!valid_) {
4024 BPLOG(ERROR) << "Invalid MinidumpMemoryInfoList for" 4025 BPLOG(ERROR) << "Invalid MinidumpMemoryInfoList for"
4025 " GetMemoryInfoForAddress"; 4026 " GetMemoryInfoForAddress";
4026 return NULL; 4027 return NULL;
4027 } 4028 }
4028 4029
4029 unsigned int info_index; 4030 unsigned int info_index;
4030 if (!range_map_->RetrieveRange(address, &info_index, NULL, NULL)) { 4031 if (!range_map_->RetrieveRange(address, &info_index, NULL, NULL, NULL)) {
4031 BPLOG(INFO) << "MinidumpMemoryInfoList has no memory info at " << 4032 BPLOG(INFO) << "MinidumpMemoryInfoList has no memory info at " <<
4032 HexString(address); 4033 HexString(address);
4033 return NULL; 4034 return NULL;
4034 } 4035 }
4035 4036
4036 return GetMemoryInfoAtIndex(info_index); 4037 return GetMemoryInfoAtIndex(info_index);
4037 } 4038 }
4038 4039
4039 4040
4040 void MinidumpMemoryInfoList::Print() { 4041 void MinidumpMemoryInfoList::Print() {
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
4865 return NULL; 4866 return NULL;
4866 } 4867 }
4867 4868
4868 *stream = new_stream.release(); 4869 *stream = new_stream.release();
4869 info->stream = *stream; 4870 info->stream = *stream;
4870 return *stream; 4871 return *stream;
4871 } 4872 }
4872 4873
4873 4874
4874 } // namespace google_breakpad 4875 } // namespace google_breakpad
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698