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

Unified Diff: tools/grokdump.py

Issue 902853002: Grokdump workaround for different layout of *_LIST structures written to minidumps on Mac. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 5a5cf4ba68ed351efadb49d0fbabd800a15adfa1..9d7fe16537ff7d4edbc839138ce1c5a256d37289 100755
--- a/tools/grokdump.py
+++ b/tools/grokdump.py
@@ -434,6 +434,12 @@ MINIDUMP_MEMORY_LIST = Descriptor([
("ranges", lambda m: MINIDUMP_MEMORY_DESCRIPTOR.ctype * m.range_count)
])
+MINIDUMP_MEMORY_LIST_Mac = Descriptor([
+ ("range_count", ctypes.c_uint32),
+ ("junk", ctypes.c_uint32),
+ ("ranges", lambda m: MINIDUMP_MEMORY_DESCRIPTOR.ctype * m.range_count)
+])
+
MINIDUMP_MEMORY_LIST64 = Descriptor([
("range_count", ctypes.c_uint64),
("base_rva", ctypes.c_uint64),
@@ -455,6 +461,12 @@ MINIDUMP_THREAD_LIST = Descriptor([
("threads", lambda t: MINIDUMP_THREAD.ctype * t.thread_count)
])
+MINIDUMP_THREAD_LIST_Mac = Descriptor([
+ ("thread_count", ctypes.c_uint32),
+ ("junk", ctypes.c_uint32),
+ ("threads", lambda t: MINIDUMP_THREAD.ctype * t.thread_count)
+])
+
MINIDUMP_VS_FIXEDFILEINFO = Descriptor([
("dwSignature", ctypes.c_uint32),
("dwStrucVersion", ctypes.c_uint32),
@@ -489,6 +501,12 @@ MINIDUMP_MODULE_LIST = Descriptor([
("modules", lambda t: MINIDUMP_RAW_MODULE.ctype * t.number_of_modules)
])
+MINIDUMP_MODULE_LIST_Mac = Descriptor([
+ ("number_of_modules", ctypes.c_uint32),
+ ("junk", ctypes.c_uint32),
+ ("modules", lambda t: MINIDUMP_RAW_MODULE.ctype * t.number_of_modules)
+])
+
MINIDUMP_RAW_SYSTEM_INFO = Descriptor([
("processor_architecture", ctypes.c_uint16)
])
@@ -570,6 +588,9 @@ class MinidumpReader(object):
DebugPrint(self.exception_context)
elif d.stream_type == MD_THREAD_LIST_STREAM:
thread_list = MINIDUMP_THREAD_LIST.Read(self.minidump, d.location.rva)
+ if ctypes.sizeof(thread_list) + 4 == d.location.data_size:
+ thread_list = MINIDUMP_THREAD_LIST_Mac.Read(
+ self.minidump, d.location.rva)
assert ctypes.sizeof(thread_list) == d.location.data_size
DebugPrint(thread_list)
for thread in thread_list.threads:
@@ -579,12 +600,19 @@ class MinidumpReader(object):
assert self.module_list is None
self.module_list = MINIDUMP_MODULE_LIST.Read(
self.minidump, d.location.rva)
+ if ctypes.sizeof(self.module_list) + 4 == d.location.data_size:
+ self.module_list = MINIDUMP_MODULE_LIST_Mac.Read(
+ self.minidump, d.location.rva)
assert ctypes.sizeof(self.module_list) == d.location.data_size
+ DebugPrint(self.module_list)
elif d.stream_type == MD_MEMORY_LIST_STREAM:
print >>sys.stderr, "Warning: This is not a full minidump!"
assert self.memory_list is None
self.memory_list = MINIDUMP_MEMORY_LIST.Read(
self.minidump, d.location.rva)
+ if ctypes.sizeof(self.memory_list) + 4 == d.location.data_size:
+ self.memory_list = MINIDUMP_MEMORY_LIST_Mac.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:
« 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