Skip to content

Commit 8532f9d

Browse files
authored
Unrolled build for #147177
Rollup merge of #147177 - Walnut356:tuples, r=Mark-Simulacrum [DebugInfo] Fix MSVC tuple child creation This is a fix for the debugger visualizer scripts For whatever reason, using `CreateChildAtOffset` on the child element sometimes caused issues with pointers (and maybe some other types). The resulting child's memory would be a block 4 bytes too far forward. Creating the child off of the parent `valobj` and using the type definition to get the correct offset seems to fix that. Before: <img width="489" height="136" alt="image" src="https://github.com/user-attachments/assets/fb4cb95c-f199-49a6-8eba-6d3ff486b69a" /> After: <img width="518" height="145" alt="image" src="https://github.com/user-attachments/assets/3f50dbc3-19ca-4fd8-87c5-b4be295f6e7c" /> This shouldn't affect any tests as we don't run debuginfo tests for MSVC afaik
2 parents d4ae855 + 1f8bef5 commit 8532f9d

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)