llvm-project/lldb
Enrico Granata d07cfd3ae4 Extend synthetic children to produce synthetic values (as in, those that GetValueAsUnsigned(), GetValueAsCString() would return)
The way to do this is to write a synthetic child provider for your type, and have it vend the (optional) get_value function.
If get_value is defined, and it returns a valid SBValue, that SBValue's value (as in lldb_private::Value) will be used as the synthetic ValueObject's Value

The rationale for doing things this way is twofold:

- there are many possible ways to define a "value" (SBData, a Python number, ...) but SBValue seems general enough as a thing that stores a "value", so we just trade values that way and that keeps our currency trivial
- we could introduce a new level of layering (ValueObjectSyntheticValue), a new kind of formatter (synthetic value producer), but that would complicate the model (can I have a dynamic with no synthetic children but synthetic value? synthetic value with synthetic children but no dynamic?), and I really couldn't see much benefit to be reaped from this added complexity in the matrix
On the other hand, just defining a synthetic child provider with a get_value but returning no actual children is easy enough that it's not a significant road-block to adoption of this feature

Comes with a test case

llvm-svn: 219330
2014-10-08 18:27:36 +00:00
..
docs Change the encoding of the Triple string exchanged across GDB-RSP 2014-08-01 05:12:23 +00:00
examples Improved the TreeItem delegate which simplifies making tree items: 2014-10-07 17:30:23 +00:00
gtest Fix stale comments in new tests. 2014-10-02 19:48:30 +00:00
include Extend synthetic children to produce synthetic values (as in, those that GetValueAsUnsigned(), GetValueAsCString() would return) 2014-10-08 18:27:36 +00:00
lib build: attempt to fix the buildbots 2014-09-08 04:53:03 +00:00
lldb.xcodeproj Update xcode project file to match zach's move of connetionfiledescriptor in r219143. 2014-10-06 22:15:29 +00:00
lldb.xcworkspace Fixup gtest layout, add Linux ThreadStateCoordinator.cpp. 2014-09-25 19:25:07 +00:00
resources Bump the verison number in the xcode project files. 2014-08-21 23:27:02 +00:00
scripts Extend synthetic children to produce synthetic values (as in, those that GetValueAsUnsigned(), GetValueAsCString() would return) 2014-10-08 18:27:36 +00:00
source Extend synthetic children to produce synthetic values (as in, those that GetValueAsUnsigned(), GetValueAsCString() would return) 2014-10-08 18:27:36 +00:00
test Extend synthetic children to produce synthetic values (as in, those that GetValueAsUnsigned(), GetValueAsCString() would return) 2014-10-08 18:27:36 +00:00
tools Move ConnectionFileDescriptor to platform-specific Host directory. 2014-10-06 21:22:36 +00:00
utils LUI: Fix some issues causing crashes in the source view 2013-10-23 01:18:21 +00:00
www Add documentation about the new SBExecutionContext for Python commands feature. This marks the end of rdar://18142728 2014-10-01 21:53:32 +00:00
.arcconfig Update .arcconfig to point to reviews.llvm.org 2014-05-20 21:24:59 +00:00
.clang-format Fix .clang-format file to adhere to LLDB 140 column limit. 2014-08-19 17:18:38 +00:00
.gitignore Update .gitignore for MacOSX 2014-08-14 20:19:57 +00:00
CMakeLists.txt build: fix cmake warning with newer CMake 2014-07-20 05:28:55 +00:00
INSTALL.txt Update INSTALL.txt to mention LLDB builds on Linux with GCC or Clang. 2013-02-21 22:37:18 +00:00
LICENSE.TXT
Makefile Remove the -Wno-unused-function option. We are clean 2014-09-09 07:49:15 +00:00