Commit 4fad53a5 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[tools] Fix bugs in grokdump

NOTRY=true

Change-Id: I08b5bf55960d8a2f4e29fc278bd4ff79b8ba7f98
Reviewed-on: https://chromium-review.googlesource.com/472806Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44519}
parent d50ebde7
...@@ -2050,11 +2050,11 @@ class InspectionPadawan(object): ...@@ -2050,11 +2050,11 @@ class InspectionPadawan(object):
Try to print a possible message from PushStackTraceAndDie. Try to print a possible message from PushStackTraceAndDie.
Returns the first address where the normal stack starts again. Returns the first address where the normal stack starts again.
""" """
# Only look at the first 32 words on the stack # Only look at the first 1k words on the stack
ptr_size = self.reader.PointerSize() ptr_size = self.reader.PointerSize()
if start is None: if start is None:
start = self.reader.ExceptionSP() start = self.reader.ExceptionSP()
end = start + ptr_size * 32 end = start + ptr_size * 1024
message_start = 0 message_start = 0
magic1 = None magic1 = None
for slot in xrange(start, end, ptr_size): for slot in xrange(start, end, ptr_size):
...@@ -2148,9 +2148,10 @@ class InspectionPadawan(object): ...@@ -2148,9 +2148,10 @@ class InspectionPadawan(object):
if not self.reader.Is64(): if not self.reader.Is64():
frame_pointer = self.reader.ExceptionFP() frame_pointer = self.reader.ExceptionFP()
# Follow the framepointer into the address range # Follow the framepointer into the address range
while frame_pointer < start: while frame_pointer and frame_pointer < start:
frame_pointer = self.reader.ReadUIntPtr(frame_pointer) frame_pointer = self.reader.ReadUIntPtr(frame_pointer)
if not self.reader.IsExceptionStackAddress(frame_pointer): if not self.reader.IsExceptionStackAddress(frame_pointer) or \
not frame_pointer:
frame_pointer = 0 frame_pointer = 0
break break
in_oom_dump_area = False in_oom_dump_area = False
...@@ -3632,7 +3633,7 @@ def GetModuleName(reader, module): ...@@ -3632,7 +3633,7 @@ def GetModuleName(reader, module):
def PrintModuleDetails(reader, module): def PrintModuleDetails(reader, module):
print "%s" % GetModuleName(reader, module) print "%s" % GetModuleName(reader, module)
file_version = GetVersionString(module.version_info.dwFileVersionMS, file_version = GetVersionString(module.version_info.dwFileVersionMS,
module.version_info.dwFileVersionS module.version_info.dwFileVersionLS);
product_version = GetVersionString(module.version_info.dwProductVersionMS, product_version = GetVersionString(module.version_info.dwProductVersionMS,
module.version_info.dwProductVersionLS) module.version_info.dwProductVersionLS)
print " base: %s" % reader.FormatIntPtr(module.base_of_image) print " base: %s" % reader.FormatIntPtr(module.base_of_image)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment