Commit 0f210646 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[tools] Fix frame marker printing on x64 in grokdump.py

Change-Id: I744d6ffca3747c166e8de194c2a7196b46b73f45

NOTRY=true

Change-Id: I744d6ffca3747c166e8de194c2a7196b46b73f45
Reviewed-on: https://chromium-review.googlesource.com/493748Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45061}
parent cedc6ccf
...@@ -1952,9 +1952,12 @@ class InspectionPadawan(object): ...@@ -1952,9 +1952,12 @@ class InspectionPadawan(object):
return None return None
def FrameMarkerName(self, value): def FrameMarkerName(self, value):
if 0 < value <= len(FRAME_MARKERS): # The frame marker is Smi-tagged but not Smi encoded and 0 is not a valid
return "Possibly %s frame marker" % FRAME_MARKERS[value-1] # frame type.
return "" value = (value >> 1) - 1
if 0 <= value < len(FRAME_MARKERS):
return "Possibly %s frame marker" % FRAME_MARKERS[value]
return None
def IsFrameMarker(self, slot, address): def IsFrameMarker(self, slot, address):
if not slot: return False if not slot: return False
...@@ -1964,18 +1967,17 @@ class InspectionPadawan(object): ...@@ -1964,18 +1967,17 @@ class InspectionPadawan(object):
next_address = self.reader.ReadUIntPtr(slot + self.reader.PointerSize()) next_address = self.reader.ReadUIntPtr(slot + self.reader.PointerSize())
return self.reader.IsExceptionStackAddress(next_address) return self.reader.IsExceptionStackAddress(next_address)
def FormatSmi(self, address, slot=None): def FormatSmi(self, address):
value = self.heap.SmiUntag(address) value = self.heap.SmiUntag(address)
marker = ""
if self.IsFrameMarker(slot, address):
marker = self.FrameMarkerName(value)
# On 32-bit systems almost everything looks like a Smi. # On 32-bit systems almost everything looks like a Smi.
if not self.reader.Is64() or value == 0: return marker if not self.reader.Is64() or value == 0: return None
return "Smi(%d) %s" % (value, marker) return "Smi(%d)" % value
def SenseObject(self, address, slot=None): def SenseObject(self, address, slot=None):
if self.IsFrameMarker(slot, address):
return self.FrameMarkerName(address)
if self.heap.IsSmi(address): if self.heap.IsSmi(address):
return self.FormatSmi(address, slot) return self.FormatSmi(address)
if not self.heap.IsTaggedAddress(address): return None if not self.heap.IsTaggedAddress(address): return None
tagged_address = address tagged_address = address
if self.IsInKnownOldSpace(tagged_address): if self.IsInKnownOldSpace(tagged_address):
......
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