Skip to content

Commit 1acd89b

Browse files
mdkofacebook-github-bot
authored andcommitted
Update use of GetChildAtIndex to reflect changes in API for next version of LLDB
Summary: The API for GetChildAtIndex was changed in llvm/llvm-project#140065. So that "True" at the end means something different now ("treat_as_array" rather than "can_create_synthetic"). This change will be present in the next version of LLDB used internally. Happily it looks like there's a way to update things that both doesn't break the tests with the current version while updating it for the next version; otherwise we'd have to use something like [this]( https://www.internalfb.com/code/fbsource/[959f6221198f]/fbcode/sand/tests/lldb_test_case.py?lines=53) in order to gate things (leaving this as a note for future changes). Reviewed By: zhyty Differential Revision: D79487113 fbshipit-source-id: 946f0f6d8fee72cfaf85c710fb613dda89003c6f
1 parent 6da7a31 commit 1acd89b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

hphp/tools/lldb/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def php_line_number_from_repo(func: lldb.SBValue, pc: int) -> typing.Optional[in
338338
line_table_size = sizeof.sizeof(line_table)
339339
assert line_table_size is not None
340340
for i in range(line_table_size):
341-
line_entry = idx.at(line_table, i)
341+
line_entry = idx.at(line_table, i, False)
342342

343343
if line_entry is None:
344344
break

hphp/tools/lldb/idx.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
def at(
2121
ptr: lldb.SBValue,
2222
idx: typing.Union[int, lldb.SBValue],
23+
treat_as_array: bool = True,
2324
) -> typing.Optional[lldb.SBValue]:
2425
"""Access ptr[idx]"""
2526

2627
if isinstance(idx, lldb.SBValue):
2728
idx = idx.unsigned
2829

29-
val = ptr.GetChildAtIndex(idx, lldb.eDynamicDontRunTarget, True)
30+
val = ptr.GetChildAtIndex(idx, lldb.eDynamicDontRunTarget, treat_as_array)
3031

3132
utils.debug_print(
3233
f"idx.at(ptr={ptr} ({ptr.type.name}), idx={idx}) = {val.unsigned} (0x{val.unsigned:x}) (error={val.GetError()})"

0 commit comments

Comments
 (0)