From 5e33d9d33090e2d5bbe57e0380ce89f0dc055700 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 11 Nov 2020 10:00:55 -0800 Subject: [PATCH] Some debug logging --- lldb_lookup.py | 4 ++++ lldb_providers.py | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/lldb_lookup.py b/lldb_lookup.py index 3cee519..fc006c8 100644 --- a/lldb_lookup.py +++ b/lldb_lookup.py @@ -1,5 +1,6 @@ import lldb +import sys from lldb_providers import * from rust_types import RustType, classify_struct, classify_union @@ -23,6 +24,7 @@ def summary_lookup(valobj, dict): # type: (SBValue, dict) -> str """Returns the summary provider for the given value""" rust_type = classify_rust_type(valobj.GetType()) + print('summary_lookup rust_type=%r' % (rust_type,), file=sys.stderr) if rust_type == RustType.STD_STRING: return StdStringSummaryProvider(valobj, dict) @@ -62,6 +64,7 @@ def synthetic_lookup(valobj, dict): # type: (SBValue, dict) -> object """Returns the synthetic provider for the given value""" rust_type = classify_rust_type(valobj.GetType()) + print('synthetic_lookup rust_type=%r' % (rust_type,), file=sys.stderr) if rust_type == RustType.STRUCT: return StructSyntheticProvider(valobj, dict) @@ -88,6 +91,7 @@ def synthetic_lookup(valobj, dict): if rust_type == RustType.STD_HASH_MAP: if is_hashbrown_hashmap(valobj): + print('is_hashbrown', file=sys.stderr) return StdHashMapSyntheticProvider(valobj, dict) else: return StdOldHashMapSyntheticProvider(valobj, dict) diff --git a/lldb_providers.py b/lldb_providers.py index 64cb983..a27a73f 100644 --- a/lldb_providers.py +++ b/lldb_providers.py @@ -234,10 +234,12 @@ def __init__(self, valobj, dict, is_variant=False): def num_children(self): # type: () -> int + print('tuple num_children=%r' % (self.size,), file=sys.stderr) return self.size def get_child_index(self, name): # type: (str) -> int + print('tuple get_child_index=%r' % (name,), file=sys.stderr) if name.isdigit(): return int(name) else: @@ -245,6 +247,7 @@ def get_child_index(self, name): def get_child_at_index(self, index): # type: (int) -> SBValue + print('tuple get_child_at_index=%r' % (index,), file=sys.stderr) if self.is_variant: field = self.type.GetFieldAtIndex(index + 1) else: @@ -500,10 +503,12 @@ def __init__(self, valobj, dict, show_values=True): def num_children(self): # type: () -> int + print('num_children=%r' % (self.size,), file=sys.stderr) return self.size def get_child_index(self, name): # type: (str) -> int + print('get_child_index %r' % (name,), file=sys.stderr) index = name.lstrip('[').rstrip(']') if index.isdigit(): return int(index) @@ -512,6 +517,7 @@ def get_child_index(self, name): def get_child_at_index(self, index): # type: (int) -> SBValue + print('get_child_at_index %r' % (index,), file=sys.stderr) pairs_start = self.data_ptr.GetValueAsUnsigned() idx = self.valid_indices[index] if self.new_layout: @@ -526,6 +532,7 @@ def get_child_at_index(self, index): def update(self): # type: () -> None + print('update', file=sys.stderr) table = self.table() capacity = table.GetChildMemberWithName("bucket_mask").GetValueAsUnsigned() + 1 ctrl = table.GetChildMemberWithName("ctrl").GetChildAtIndex(0) @@ -554,6 +561,7 @@ def update(self): def table(self): # type: () -> SBValue + print('table', file=sys.stderr) if self.show_values: hashbrown_hashmap = self.valobj.GetChildMemberWithName("base") else: