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

Unified Diff: src/processor/basic_code_modules.cc

Issue 2029953003: Adding support for overlapping ranges to RangeMap. (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Last patch set after git pull. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/processor/basic_code_modules.h ('k') | src/processor/basic_source_line_resolver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/processor/basic_code_modules.cc
diff --git a/src/processor/basic_code_modules.cc b/src/processor/basic_code_modules.cc
index 40b45a8bf8876f8317c7554050b2a3c2a8573328..00dc6fcb7f2f8de67a6d2a6fbbb7998e2c8f4444 100644
--- a/src/processor/basic_code_modules.cc
+++ b/src/processor/basic_code_modules.cc
@@ -46,8 +46,7 @@
namespace google_breakpad {
BasicCodeModules::BasicCodeModules(const CodeModules *that)
- : main_address_(0),
- map_(new RangeMap<uint64_t, linked_ptr<const CodeModule> >()) {
+ : main_address_(0), map_() {
BPLOG_IF(ERROR, !that) << "BasicCodeModules::BasicCodeModules requires "
"|that|";
assert(that);
@@ -66,30 +65,27 @@ BasicCodeModules::BasicCodeModules(const CodeModules *that)
// GetModuleAtSequence.
linked_ptr<const CodeModule> module(
that->GetModuleAtIndex(module_sequence)->Copy());
- if (!map_->StoreRange(module->base_address(), module->size(), module)) {
+ if (!map_.StoreRange(module->base_address(), module->size(), module)) {
BPLOG(ERROR) << "Module " << module->code_file() <<
" could not be stored";
}
}
}
-BasicCodeModules::BasicCodeModules()
- : main_address_(0),
- map_(new RangeMap<uint64_t, linked_ptr<const CodeModule> >()) {
-}
+BasicCodeModules::BasicCodeModules() : main_address_(0), map_() { }
BasicCodeModules::~BasicCodeModules() {
- delete map_;
}
unsigned int BasicCodeModules::module_count() const {
- return map_->GetCount();
+ return map_.GetCount();
}
const CodeModule* BasicCodeModules::GetModuleForAddress(
uint64_t address) const {
linked_ptr<const CodeModule> module;
- if (!map_->RetrieveRange(address, &module, NULL, NULL)) {
+ if (!map_.RetrieveRange(address, &module, NULL /* base */, NULL /* delta */,
+ NULL /* size */)) {
BPLOG(INFO) << "No module at " << HexString(address);
return NULL;
}
@@ -104,7 +100,8 @@ const CodeModule* BasicCodeModules::GetMainModule() const {
const CodeModule* BasicCodeModules::GetModuleAtSequence(
unsigned int sequence) const {
linked_ptr<const CodeModule> module;
- if (!map_->RetrieveRangeAtIndex(sequence, &module, NULL, NULL)) {
+ if (!map_.RetrieveRangeAtIndex(sequence, &module, NULL /* base */,
+ NULL /* delta */, NULL /* size */)) {
BPLOG(ERROR) << "RetrieveRangeAtIndex failed for sequence " << sequence;
return NULL;
}
« no previous file with comments | « src/processor/basic_code_modules.h ('k') | src/processor/basic_source_line_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698