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

Unified Diff: tools/grokdump.py

Issue 7439006: grokdump: Add simple support for non-full minudumps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grokdump.py
diff --git a/tools/grokdump.py b/tools/grokdump.py
index 74521ad2195eb8bec632d27900a4dae270e6dba2..468e7cc6b799ff5ffa69e125f01529155b19128e 100755
--- a/tools/grokdump.py
+++ b/tools/grokdump.py
@@ -291,6 +291,7 @@ class MinidumpReader(object):
self.exception = None
self.exception_context = None
self.memory_list = None
+ self.memory_list64 = None
self.thread_map = {}
for d in directories:
DebugPrint(d)
@@ -311,16 +312,17 @@ class MinidumpReader(object):
self.thread_map[thread.id] = thread
elif d.stream_type == MD_MEMORY_LIST_STREAM:
print >>sys.stderr, "Warning: not a full minidump"
- ml = MINIDUMP_MEMORY_LIST.Read(self.minidump, d.location.rva)
- DebugPrint(ml)
- for m in ml.ranges:
- DebugPrint(m)
- elif d.stream_type == MD_MEMORY_64_LIST_STREAM:
assert self.memory_list is None
- self.memory_list = MINIDUMP_MEMORY_LIST64.Read(
+ self.memory_list = MINIDUMP_MEMORY_LIST.Read(
self.minidump, d.location.rva)
assert ctypes.sizeof(self.memory_list) == d.location.data_size
DebugPrint(self.memory_list)
+ elif d.stream_type == MD_MEMORY_64_LIST_STREAM:
+ assert self.memory_list64 is None
+ self.memory_list64 = MINIDUMP_MEMORY_LIST64.Read(
+ self.minidump, d.location.rva)
+ assert ctypes.sizeof(self.memory_list64) == d.location.data_size
+ DebugPrint(self.memory_list64)
def IsValidAddress(self, address):
return self.FindLocation(address) is not None
@@ -338,12 +340,16 @@ class MinidumpReader(object):
return self.minidump[location:location + size]
def FindLocation(self, address):
- # TODO(vitalyr): only works for full minidumps (...64 structure variants).
offset = 0
- for r in self.memory_list.ranges:
- if r.start <= address < r.start + r.size:
- return self.memory_list.base_rva + offset + address - r.start
+ if self.memory_list64 is not None:
+ for r in self.memory_list64.ranges:
+ if r.start <= address < r.start + r.size:
+ return self.memory_list64.base_rva + offset + address - r.start
offset += r.size
+ if self.memory_list is not None:
+ for r in self.memory_list.ranges:
+ if r.start <= address < r.start + r.memory.data_size:
+ return r.memory.rva + address - r.start
return None
def GetDisasmLines(self, address, size):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698