Files
clang-p2996/lldb/test/python_api/formatters/jas_synth.py
Enrico Granata c5bc412cf6 Synthetic values are now automatically enabled and active by default. SBValue is set up to always wrap a synthetic value when one is available.
A new setting enable-synthetic-value is provided on the target to disable this behavior.
There also is a new GetNonSyntheticValue() API call on SBValue to go back from synthetic to non-synthetic. There is no call to go from non-synthetic to synthetic.
The test suite has been changed accordingly.
Fallout from changes to type searching: an hack has to be played to make it possible to use maps that contain std::string due to the special name replacement operated by clang
Fixing a test case that was using libstdcpp instead of libc++ - caught as a consequence of said changes to type searching

llvm-svn: 153495
2012-03-27 02:35:13 +00:00

25 lines
801 B
Python

import lldb
class jasSynthProvider:
def __init__(self, valobj, dict):
self.valobj = valobj;
def num_children(self):
return 2;
def get_child_at_index(self, index):
child = None
if index == 0:
child = self.valobj.GetChildMemberWithName('A');
if index == 1:
child = self.valobj.CreateValueFromExpression('X', '(int)1')
return child;
def get_child_index(self, name):
if name == 'A':
return 0;
if name == 'X':
return 1;
return None;
def __lldb_init_module(debugger,dict):
debugger.CreateCategory("JASSynth").AddTypeSynthetic(lldb.SBTypeNameSpecifier("JustAStruct"),
lldb.SBTypeSynthetic.CreateWithClassName("jas_synth.jasSynthProvider"))