diff options
| author | Enrico Granata <egranata@apple.com> | 2012-03-27 02:35:13 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2012-03-27 02:35:13 +0000 |
| commit | c5bc412cf6cb8ca4a8aaa33b36519affea73f9b7 (patch) | |
| tree | 115bd96399cee3c0d45d3bf48cce6132de153a52 /lldb/examples/synthetic | |
| parent | fe384a2c84fb9808be47c894bd445bc18891556a (diff) | |
| download | bcm5719-llvm-c5bc412cf6cb8ca4a8aaa33b36519affea73f9b7.tar.gz bcm5719-llvm-c5bc412cf6cb8ca4a8aaa33b36519affea73f9b7.zip | |
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
Diffstat (limited to 'lldb/examples/synthetic')
| -rw-r--r-- | lldb/examples/synthetic/gnu_libstdcpp.py | 40 | ||||
| -rw-r--r-- | lldb/examples/synthetic/libcxx.py | 2 |
2 files changed, 30 insertions, 12 deletions
diff --git a/lldb/examples/synthetic/gnu_libstdcpp.py b/lldb/examples/synthetic/gnu_libstdcpp.py index dc3946df5be..fb970e8bc43 100644 --- a/lldb/examples/synthetic/gnu_libstdcpp.py +++ b/lldb/examples/synthetic/gnu_libstdcpp.py @@ -85,6 +85,8 @@ class StdListSynthProvider: def extract_type(self): list_type = self.valobj.GetType().GetUnqualifiedType() + if list_type.IsReferenceType(): + list_type = list_type.GetDereferencedType() if list_type.GetNumberOfTemplateArguments() > 0: data_type = list_type.GetTemplateArgumentType(0) else: @@ -200,15 +202,15 @@ class StdMapSynthProvider: # to replace the longer versions of std::string with the shorter one in order to be able # to find the type name def fixup_class_name(self, class_name): - if class_name == 'std::basic_string<char, class std::char_traits<char>, class std::allocator<char> >': - return 'std::basic_string<char>' - if class_name == 'basic_string<char, class std::char_traits<char>, class std::allocator<char> >': - return 'std::basic_string<char>' if class_name == 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >': - return 'std::basic_string<char>' + return 'std::basic_string<char>',True if class_name == 'basic_string<char, std::char_traits<char>, std::allocator<char> >': - return 'std::basic_string<char>' - return class_name + return 'std::basic_string<char>',True + if class_name == 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >': + return 'std::basic_string<char>',True + if class_name == 'basic_string<char, std::char_traits<char>, std::allocator<char> >': + return 'std::basic_string<char>',True + return class_name,False def update(self): try: @@ -216,13 +218,27 @@ class StdMapSynthProvider: self.Mimpl = self.Mt.GetChildMemberWithName('_M_impl') self.Mheader = self.Mimpl.GetChildMemberWithName('_M_header') - map_arg_0 = str(self.valobj.GetType().GetTemplateArgumentType(0).GetName()) - map_arg_1 = str(self.valobj.GetType().GetTemplateArgumentType(1).GetName()) + map_type = self.valobj.GetType() + if map_type.IsReferenceType(): + map_type = map_type.GetDereferencedType() + + map_arg_0 = str(map_type.GetTemplateArgumentType(0).GetName()) + map_arg_1 = str(map_type.GetTemplateArgumentType(1).GetName()) - map_arg_0 = self.fixup_class_name(map_arg_0) - map_arg_1 = self.fixup_class_name(map_arg_1) + map_arg_0,fixed_0 = self.fixup_class_name(map_arg_0) + map_arg_1,fixed_1 = self.fixup_class_name(map_arg_1) + + # HACK: this is related to the above issue with the typename for std::string + # being shortened by clang - the changes to typename display and searching to honor + # namespaces make it so that we go looking for std::pair<const std::basic_string<char>, ...> + # but when we find a type for this, we then compare it against the fully-qualified + # std::pair<const std::basic_string<char, std::char_traits... and of course fail + # the way to bypass this problem is to avoid using the std:: prefix in this specific case + if fixed_0 or fixed_1: + map_arg_type = "pair<const " + map_arg_0 + ", " + map_arg_1 + else: + map_arg_type = "std::pair<const " + map_arg_0 + ", " + map_arg_1 - map_arg_type = "std::pair<const " + map_arg_0 + ", " + map_arg_1 if map_arg_1[-1] == '>': map_arg_type = map_arg_type + " >" else: diff --git a/lldb/examples/synthetic/libcxx.py b/lldb/examples/synthetic/libcxx.py index ed6928ec7d1..fb43b10ef10 100644 --- a/lldb/examples/synthetic/libcxx.py +++ b/lldb/examples/synthetic/libcxx.py @@ -253,6 +253,8 @@ class stdlist_SynthProvider: def extract_type(self): list_type = self.valobj.GetType().GetUnqualifiedType() + if list_type.IsReferenceType(): + list_type = list_type.GetDereferencedType() if list_type.GetNumberOfTemplateArguments() > 0: data_type = list_type.GetTemplateArgumentType(0) else: |

