llvm-project/lldb/source
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
..
API Extend synthetic children to produce synthetic values (as in, those that GetValueAsUnsigned(), GetValueAsCString() would return) 2014-10-08 18:27:36 +00:00
Breakpoint Rework how resetting breakpoints in changed modules works. Try to match up old 2014-09-10 21:40:47 +00:00
Commands Issuing a "type category disable *" command followed by a "type category enable *" command does not honor the order in which categories were previously enabled 2014-10-03 01:48:32 +00:00
Core Extend synthetic children to produce synthetic values (as in, those that GetValueAsUnsigned(), GetValueAsCString() would return) 2014-10-08 18:27:36 +00:00
DataFormatters Extend synthetic children to produce synthetic values (as in, those that GetValueAsUnsigned(), GetValueAsCString() would return) 2014-10-08 18:27:36 +00:00
Expression Add "target.expr-parser-compiler-args" setting. 2014-10-06 23:13:30 +00:00
Host llgs: add logging to Native*Protocol breakpoints around byte values replaced and restored. 2014-10-08 17:14:53 +00:00
Interpreter Extend synthetic children to produce synthetic values (as in, those that GetValueAsUnsigned(), GetValueAsCString() would return) 2014-10-08 18:27:36 +00:00
Plugins When we detect a stack unwind loop, before we abort 2014-10-07 22:55:13 +00:00
Symbol Very minimal support 24-bit kalimbas. Vanilla "memory read" for data sections 2014-09-29 08:02:24 +00:00
Target Minor comment change to test out svn access 2014-10-08 01:50:37 +00:00
Utility Fix the ability of "lldb-platform" to upload files. 2014-09-18 00:20:51 +00:00
CMakeLists.txt Add SBExecutionContext.cpp to this file as well, as the comment 2014-10-01 22:26:52 +00:00
Makefile Make lldb build with Makefiles on OS X. 2014-01-18 08:05:32 +00:00
lldb-log.cpp Make sure to #include <atomic> when using std::atomic. 2014-09-19 20:12:32 +00:00
lldb.cpp ASan malloc/free history threads 2014-09-04 01:03:18 +00:00