[lldb] Fix gnu_libstdcpp's update methods
authorWalter Erquinigo <a20012251@gmail.com>
Wed, 26 May 2021 21:30:48 +0000 (14:30 -0700)
committerWalter Erquinigo <a20012251@gmail.com>
Wed, 26 May 2021 21:52:38 +0000 (14:52 -0700)
commit0283abee5c87e86552b456a34d01311b66c37207
treea26f6467eef5e27bd7c4cc93c1298e8d7796b395
parent1032886a41c6ef386e5280344958dbdba337779f
[lldb] Fix gnu_libstdcpp's update methods

The variable.rst documentation says:

```
If it returns a value, and that value is True, LLDB will be allowed to cache the children and the children count it previously obtained, and will not return to the provider class to ask.  If nothing, None, or anything other than True is returned, LLDB will discard the cached information and ask. Regardless, whenever necessary LLDB will call update.
```

However, several update methods in gnu_libstdcpp.py were returning True,
which made lldb unaware of any changes in the corresponding objects.
This problem was visible by lldb-vscode in the following way:

- If a breakpoint is hit and there's a vector with the contents {1, 2},
  it'll be displayed correctly.
- Then the user steps and the next stop contains the vector modified.
  The program changed it to {1, 2, 3}
- frame var then displays {1, 2} incorrectly, due to the caching caused
by the update method

It's worth mentioning that none of libcxx.py'd update methods return True. Same for LibCxxVector.cpp, which returns false.

Added a very simple test that fails without this fix.

Differential Revision: https://reviews.llvm.org/D103209
lldb/examples/synthetic/gnu_libstdcpp.py
lldb/test/API/tools/lldb-vscode/evaluate/TestVSCode_evaluate.py
lldb/test/API/tools/lldb-vscode/evaluate/main.cpp