[Lldb-commits] [PATCH] D103209: [lldb] Fix gnu_libstdcpp's update methods

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed May 26 14:41:19 PDT 2021


wallace created this revision.
wallace requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103209

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103209.348099.patch
Type: text/x-patch
Size: 3475 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210526/6fa18bc0/attachment.bin>


More information about the lldb-commits mailing list