Skip to content

Commit 9085902

Browse files
Tom Yangfacebook-github-bot
authored andcommitted
fix lookup test failure
Summary: Related to D79487113. The changes to the `GetChildAtIndex` API from llvm/llvm-project#140065 also seems to affect other HPHP-lldb helper functions. In the test, we used to see something like ``` (HPHP::Func *) m_s = NULL ``` But now, it's like ``` (HPHP::Func *) [0] = NULL ``` See the [Sandcastle test failure](https://www.internalfb.com/sandcastle/workflow/725079540015841236/artifact/actionlog.725079540171251401.stderr.1?selectedLines=650-650-117-117). # Additional context The test failure is in `test_lookup.py`, specifically the `LookupCommandTestCase.test_lookup_func_command`. The failure happens in the `lookup func 0` command. It appears to be because we're now trying to read from some `AtomicLowPtrVector` as an array, which now causes the `func_ptr` to be displayed. The trace roughly starts from [lookup.py (_lookup_func_prep)](https://www.internalfb.com/code/fbsource/[bdc39ed90991]/fbcode/hphp/tools/lldb/lookup.py?lines=226). The change in behavior eventually comes from the `idx.atomic_low_ptr_vector_at` call around [here](https://www.internalfb.com/code/fbsource/[506e8e599f3c]/fbcode/hphp/tools/lldb/lookup.py?lines=58). It seems this is because we have a call within `idx.atomic_low_ptr_vector_at` (eventually) that calls `GetChildAtIndex(0, .., True)`, where `True` is the `treat_as_array` param. To look into the issue, I reproed using this script P1896003453. ``` lldb $HHVM -o "command script import /data/users/toyang/fbsource/fbcode/hphp/tools/lldb/hhvm.py" -o "b lookupObjMethod" -o "r" --source "$SCRIPT" -- --file /data/users/toyang/fbsource/fbcode/hphp/test/quick/method2.php -vEval.Jit=0 ``` mdko is looking into if this new behavior is desirable. Reviewed By: mdko Differential Revision: D79827088 fbshipit-source-id: 0c5eaf91bcc148e3c9347bfe7b59d1f03e7a45fd
1 parent f24b8c6 commit 9085902

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hphp/tools/lldb/test/test_lookup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_lookup_func_command(self) -> None:
1717
self.run_until_breakpoint("lookupObjMethod")
1818
_, output = self.run_commands(["lookup func 0"])
1919
self.assertRegex(
20-
output.strip(), r"\(HPHP::Func \*\) (m_s|\$\d+) = (NULL|nullptr)"
20+
output.strip(), r"\(HPHP::Func \*\) (m_s|\$\d+|\[\d+\]) = (NULL|nullptr)"
2121
)
2222

2323

0 commit comments

Comments
 (0)