[all-commits] [llvm/llvm-project] 0283ab: [lldb] Fix gnu_libstdcpp's update methods

walter erquinigo via All-commits all-commits at lists.llvm.org
Wed May 26 14:52:55 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0283abee5c87e86552b456a34d01311b66c37207
      https://github.com/llvm/llvm-project/commit/0283abee5c87e86552b456a34d01311b66c37207
  Author: Walter Erquinigo <a20012251 at gmail.com>
  Date:   2021-05-26 (Wed, 26 May 2021)

  Changed paths:
    M lldb/examples/synthetic/gnu_libstdcpp.py
    M lldb/test/API/tools/lldb-vscode/evaluate/TestVSCode_evaluate.py
    M lldb/test/API/tools/lldb-vscode/evaluate/main.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list