Reviewers: Jakob,
Message:
PTAL&CQ
Description:
Minor tools/grokdump improvements: avoid some None dereferences and add some
line breaks to generated html pages.
Please review this at https://codereview.chromium.org/943573002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+8, -5 lines):
M tools/grokdump.py
Index: tools/grokdump.py
diff --git a/tools/grokdump.py b/tools/grokdump.py
index
9d7fe16537ff7d4edbc839138ce1c5a256d37289..8986a91b5c318302c0f8ee8601d8919df675d9d6
100755
--- a/tools/grokdump.py
+++ b/tools/grokdump.py
@@ -970,8 +970,11 @@ class HeapObject(object):
p.Print(str(self))
def __str__(self):
+ instance_type = "???"
+ if self.map is not None:
+ instance_type = INSTANCE_TYPES[self.map.instance_type]
return "HeapObject(%s, %s)" %
(self.heap.reader.FormatIntPtr(self.address),
- INSTANCE_TYPES[self.map.instance_type])
+ instance_type)
def ObjectField(self, offset):
field_value = self.heap.reader.ReadUIntPtr(self.address + offset)
@@ -1386,9 +1389,9 @@ class JSFunction(HeapObject):
def __str__(self):
inferred_name = ""
- if self.shared.Is(SharedFunctionInfo):
+ if self.shared is not None and self.shared.Is(SharedFunctionInfo):
inferred_name = self.shared.inferred_name
- return "JSFunction(%s, %s)" % \
+ return "JSFunction(%s, %s) " % \
(self.heap.reader.FormatIntPtr(self.address), inferred_name)
def _GetSource(self):
@@ -2094,7 +2097,7 @@ class
InspectionWebHandler(BaseHTTPServer.BaseHTTPRequestHandler):
self.send_error(404, 'Web parameter error: %s' % e.message)
-HTML_REG_FORMAT = "<span class=\"register\"><b>%s</b>: %s</span>\n"
+HTML_REG_FORMAT = "<span
class=\"register\"><b>%s</b>: %s</span><br/>\n"
class InspectionWebFormatter(object):
@@ -2263,7 +2266,7 @@ class InspectionWebFormatter(object):
f.write("<h3>Exception context</h3>")
f.write('<div class="code">\n')
f.write("Thread id: %d" % exception_thread.id)
- f.write(" Exception code: %08X\n" %
+ f.write(" Exception code: %08X<br/>\n" %
self.reader.exception.exception.code)
if details == InspectionWebFormatter.CONTEXT_FULL:
if self.reader.exception.exception.parameter_count > 0:
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.