Commit 9085902
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: 0c5eaf91bcc148e3c9347bfe7b59d1f03e7a45fd1 parent f24b8c6 commit 9085902
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
0 commit comments