aboutsummaryrefslogtreecommitdiff
path: root/src/processor/range_map-inl.h
diff options
context:
space:
mode:
authormmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-12-05 22:52:28 +0000
committermmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-12-05 22:52:28 +0000
commitdb3342a10ec30902aa9018b80e1d9a40bd01c487 (patch)
tree933903715ae6d5d5f1b7827e0612314162b0aecf /src/processor/range_map-inl.h
parentDon't use CRT in exception handler code (#86). r=bryner (diff)
downloadbreakpad-db3342a10ec30902aa9018b80e1d9a40bd01c487.tar.xz
Module API (#32). r=waylonis, bryner
- Introduces a standard API for dealing with modules. MinidumpModule is now a concrete implementation of this API. Code may interact with single modules using the CodeModule interface, and collections of modules using its container, the CodeModules interface. - CodeModule is used directly by SymbolSupplier implementations and SourceLineResolver. Reliance on the specific implementation in MinidumpModule has been eliminated. - Module lists are now added to ProcessState objects. Module references in each stack frame are now pointers to objects in these module lists. - The sample minidump_stackwalk tool prints the module list after printing all threads' stacks. http://groups.google.com/group/airbag-dev/browse_frm/thread/a9c0550edde54cf8 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@74 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/range_map-inl.h')
-rw-r--r--src/processor/range_map-inl.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/processor/range_map-inl.h b/src/processor/range_map-inl.h
index 74ce8513..2ead2e65 100644
--- a/src/processor/range_map-inl.h
+++ b/src/processor/range_map-inl.h
@@ -142,6 +142,35 @@ bool RangeMap<AddressType, EntryType>::RetrieveNearestRange(
template<typename AddressType, typename EntryType>
+bool RangeMap<AddressType, EntryType>::RetrieveRangeAtIndex(
+ int index, EntryType *entry,
+ AddressType *entry_base, AddressType *entry_size) const {
+ if (!entry || index >= GetCount())
+ return false;
+
+ // Walk through the map. Although it's ordered, it's not a vector, so it
+ // can't be addressed directly by index.
+ MapConstIterator iterator = map_.begin();
+ for (int this_index = 0; this_index < index; ++this_index)
+ ++iterator;
+
+ *entry = iterator->second.entry();
+ if (entry_base)
+ *entry_base = iterator->first;
+ if (entry_size)
+ *entry_size = iterator->first - iterator->second.base() + 1;
+
+ return true;
+}
+
+
+template<typename AddressType, typename EntryType>
+int RangeMap<AddressType, EntryType>::GetCount() const {
+ return map_.size();
+}
+
+
+template<typename AddressType, typename EntryType>
void RangeMap<AddressType, EntryType>::Clear() {
map_.clear();
}