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

Unified Diff: tools/memory_inspector/memory_inspector/core/native_heap.py

Issue 559023002: [Android] memory_inspector: bug / UI fixes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mi1_heapdump_sigstop
Patch Set: Created 6 years, 3 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
Index: tools/memory_inspector/memory_inspector/core/native_heap.py
diff --git a/tools/memory_inspector/memory_inspector/core/native_heap.py b/tools/memory_inspector/memory_inspector/core/native_heap.py
index b7a2e932ac7bb39243f985ed6c97932349b6493f..11c903168d9ade81b997ab7bd5e377be0120b5b6 100644
--- a/tools/memory_inspector/memory_inspector/core/native_heap.py
+++ b/tools/memory_inspector/memory_inspector/core/native_heap.py
@@ -13,7 +13,7 @@ class NativeHeap(object):
"""
def __init__(self):
- self.allocations = []
+ self.allocations = [] # list of individual |Allocation|s.
self.stack_frames = {} # absolute_address (int) -> |stacktrace.Frame|.
def Add(self, allocation):
@@ -21,7 +21,8 @@ class NativeHeap(object):
self.allocations += [allocation]
def GetStackFrame(self, absolute_addr):
- assert(isinstance(absolute_addr, int))
+ """Guarantees that multiple calls with the same addr return the same obj."""
+ assert(isinstance(absolute_addr, (long, int)))
stack_frame = self.stack_frames.get(absolute_addr)
if not stack_frame:
stack_frame = stacktrace.Frame(absolute_addr)
@@ -31,6 +32,8 @@ class NativeHeap(object):
def SymbolizeUsingSymbolDB(self, symbols):
assert(isinstance(symbols, symbol.Symbols))
for stack_frame in self.stack_frames.itervalues():
+ if stack_frame.exec_file_rel_path is None:
+ continue
sym = symbols.Lookup(stack_frame.exec_file_rel_path, stack_frame.offset)
if sym:
stack_frame.SetSymbolInfo(sym)

Powered by Google App Engine
This is Rietveld 408576698