Skip to content

Commit 1f8bef5

Browse files
committed
fix tuple child creation
1 parent f957826 commit 1f8bef5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/etc/lldb_providers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,8 @@ def get_child_index(self, name: str) -> int:
761761

762762
def get_child_at_index(self, index: int) -> SBValue:
763763
child: SBValue = self.valobj.GetChildAtIndex(index)
764-
return child.CreateChildAtOffset(str(index), 0, child.GetType())
764+
offset = self.valobj.GetType().GetFieldAtIndex(index).byte_offset
765+
return self.valobj.CreateChildAtOffset(str(index), offset, child.GetType())
765766

766767
def update(self):
767768
pass
@@ -772,7 +773,7 @@ def has_children(self) -> bool:
772773
def get_type_name(self) -> str:
773774
name = self.valobj.GetTypeName()
774775
# remove "tuple$<" and ">", str.removeprefix and str.removesuffix require python 3.9+
775-
name = name[7:-1]
776+
name = name[7:-1].strip()
776777
return "(" + name + ")"
777778

778779

0 commit comments

Comments
 (0)