[Lldb-commits] [lldb] r220433 - More cleanup of the CXXFormatterFunctions header
Enrico Granata
egranata at apple.com
Wed Oct 22 14:47:27 PDT 2014
Author: enrico
Date: Wed Oct 22 16:47:27 2014
New Revision: 220433
URL: http://llvm.org/viewvc/llvm-project?rev=220433&view=rev
Log:
More cleanup of the CXXFormatterFunctions header
Modified:
lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h
lldb/trunk/source/DataFormatters/NSDictionary.cpp
lldb/trunk/source/DataFormatters/NSSet.cpp
Modified: lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h?rev=220433&r1=220432&r2=220433&view=diff
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h Wed Oct 22 16:47:27 2014
@@ -185,293 +185,8 @@ namespace lldb_private {
SyntheticChildrenFrontEnd* NSArraySyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP);
- class NSDictionaryISyntheticFrontEnd : public SyntheticChildrenFrontEnd
- {
- private:
- struct DataDescriptor_32
- {
- uint32_t _used : 26;
- uint32_t _szidx : 6;
- };
- struct DataDescriptor_64
- {
- uint64_t _used : 58;
- uint32_t _szidx : 6;
- };
-
- struct DictionaryItemDescriptor
- {
- lldb::addr_t key_ptr;
- lldb::addr_t val_ptr;
- lldb::ValueObjectSP valobj_sp;
- };
-
- public:
- NSDictionaryISyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
-
- virtual size_t
- CalculateNumChildren ();
-
- virtual lldb::ValueObjectSP
- GetChildAtIndex (size_t idx);
-
- virtual bool
- Update();
-
- virtual bool
- MightHaveChildren ();
-
- virtual size_t
- GetIndexOfChildWithName (const ConstString &name);
-
- virtual
- ~NSDictionaryISyntheticFrontEnd ();
- private:
- ExecutionContextRef m_exe_ctx_ref;
- uint8_t m_ptr_size;
- lldb::ByteOrder m_order;
- DataDescriptor_32 *m_data_32;
- DataDescriptor_64 *m_data_64;
- lldb::addr_t m_data_ptr;
- ClangASTType m_pair_type;
- std::vector<DictionaryItemDescriptor> m_children;
- };
-
- class NSDictionaryMSyntheticFrontEnd : public SyntheticChildrenFrontEnd
- {
- private:
- struct DataDescriptor_32
- {
- uint32_t _used : 26;
- uint32_t _kvo : 1;
- uint32_t _size;
- uint32_t _mutations;
- uint32_t _objs_addr;
- uint32_t _keys_addr;
- };
- struct DataDescriptor_64
- {
- uint64_t _used : 58;
- uint32_t _kvo : 1;
- uint64_t _size;
- uint64_t _mutations;
- uint64_t _objs_addr;
- uint64_t _keys_addr;
- };
- struct DictionaryItemDescriptor
- {
- lldb::addr_t key_ptr;
- lldb::addr_t val_ptr;
- lldb::ValueObjectSP valobj_sp;
- };
- public:
- NSDictionaryMSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
-
- virtual size_t
- CalculateNumChildren ();
-
- virtual lldb::ValueObjectSP
- GetChildAtIndex (size_t idx);
-
- virtual bool
- Update();
-
- virtual bool
- MightHaveChildren ();
-
- virtual size_t
- GetIndexOfChildWithName (const ConstString &name);
-
- virtual
- ~NSDictionaryMSyntheticFrontEnd ();
- private:
- ExecutionContextRef m_exe_ctx_ref;
- uint8_t m_ptr_size;
- lldb::ByteOrder m_order;
- DataDescriptor_32 *m_data_32;
- DataDescriptor_64 *m_data_64;
- ClangASTType m_pair_type;
- std::vector<DictionaryItemDescriptor> m_children;
- };
-
- class NSDictionaryCodeRunningSyntheticFrontEnd : public SyntheticChildrenFrontEnd
- {
- public:
- NSDictionaryCodeRunningSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
-
- virtual size_t
- CalculateNumChildren ();
-
- virtual lldb::ValueObjectSP
- GetChildAtIndex (size_t idx);
-
- virtual bool
- Update();
-
- virtual bool
- MightHaveChildren ();
-
- virtual size_t
- GetIndexOfChildWithName (const ConstString &name);
-
- virtual
- ~NSDictionaryCodeRunningSyntheticFrontEnd ();
- };
-
SyntheticChildrenFrontEnd* NSDictionarySyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP);
- class NSSetISyntheticFrontEnd : public SyntheticChildrenFrontEnd
- {
- private:
- struct DataDescriptor_32
- {
- uint32_t _used : 26;
- uint32_t _szidx : 6;
- };
- struct DataDescriptor_64
- {
- uint64_t _used : 58;
- uint32_t _szidx : 6;
- };
-
- struct SetItemDescriptor
- {
- lldb::addr_t item_ptr;
- lldb::ValueObjectSP valobj_sp;
- };
-
- public:
- NSSetISyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
-
- virtual size_t
- CalculateNumChildren ();
-
- virtual lldb::ValueObjectSP
- GetChildAtIndex (size_t idx);
-
- virtual bool
- Update();
-
- virtual bool
- MightHaveChildren ();
-
- virtual size_t
- GetIndexOfChildWithName (const ConstString &name);
-
- virtual
- ~NSSetISyntheticFrontEnd ();
- private:
- ExecutionContextRef m_exe_ctx_ref;
- uint8_t m_ptr_size;
- DataDescriptor_32 *m_data_32;
- DataDescriptor_64 *m_data_64;
- lldb::addr_t m_data_ptr;
- std::vector<SetItemDescriptor> m_children;
- };
-
- class NSOrderedSetSyntheticFrontEnd : public SyntheticChildrenFrontEnd
- {
- private:
-
- public:
- NSOrderedSetSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
-
- virtual size_t
- CalculateNumChildren ();
-
- virtual lldb::ValueObjectSP
- GetChildAtIndex (size_t idx);
-
- virtual bool
- Update();
-
- virtual bool
- MightHaveChildren ();
-
- virtual size_t
- GetIndexOfChildWithName (const ConstString &name);
-
- virtual
- ~NSOrderedSetSyntheticFrontEnd ();
- private:
- uint32_t m_count;
- std::map<uint32_t,lldb::ValueObjectSP> m_children;
- };
-
- class NSSetMSyntheticFrontEnd : public SyntheticChildrenFrontEnd
- {
- private:
- struct DataDescriptor_32
- {
- uint32_t _used : 26;
- uint32_t _size;
- uint32_t _mutations;
- uint32_t _objs_addr;
- };
- struct DataDescriptor_64
- {
- uint64_t _used : 58;
- uint64_t _size;
- uint64_t _mutations;
- uint64_t _objs_addr;
- };
- struct SetItemDescriptor
- {
- lldb::addr_t item_ptr;
- lldb::ValueObjectSP valobj_sp;
- };
- public:
- NSSetMSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
-
- virtual size_t
- CalculateNumChildren ();
-
- virtual lldb::ValueObjectSP
- GetChildAtIndex (size_t idx);
-
- virtual bool
- Update();
-
- virtual bool
- MightHaveChildren ();
-
- virtual size_t
- GetIndexOfChildWithName (const ConstString &name);
-
- virtual
- ~NSSetMSyntheticFrontEnd ();
- private:
- ExecutionContextRef m_exe_ctx_ref;
- uint8_t m_ptr_size;
- DataDescriptor_32 *m_data_32;
- DataDescriptor_64 *m_data_64;
- std::vector<SetItemDescriptor> m_children;
- };
-
- class NSSetCodeRunningSyntheticFrontEnd : public SyntheticChildrenFrontEnd
- {
- public:
- NSSetCodeRunningSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
-
- virtual size_t
- CalculateNumChildren ();
-
- virtual lldb::ValueObjectSP
- GetChildAtIndex (size_t idx);
-
- virtual bool
- Update();
-
- virtual bool
- MightHaveChildren ();
-
- virtual size_t
- GetIndexOfChildWithName (const ConstString &name);
-
- virtual
- ~NSSetCodeRunningSyntheticFrontEnd ();
- };
-
SyntheticChildrenFrontEnd* NSSetSyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP);
SyntheticChildrenFrontEnd* NSIndexPathSyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP);
Modified: lldb/trunk/source/DataFormatters/NSDictionary.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/NSDictionary.cpp?rev=220433&r1=220432&r2=220433&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/NSDictionary.cpp (original)
+++ lldb/trunk/source/DataFormatters/NSDictionary.cpp Wed Oct 22 16:47:27 2014
@@ -57,6 +57,143 @@ GetLLDBNSPairType (TargetSP target_sp)
return clang_type;
}
+namespace lldb_private {
+ namespace formatters {
+ class NSDictionaryISyntheticFrontEnd : public SyntheticChildrenFrontEnd
+ {
+ private:
+ struct DataDescriptor_32
+ {
+ uint32_t _used : 26;
+ uint32_t _szidx : 6;
+ };
+ struct DataDescriptor_64
+ {
+ uint64_t _used : 58;
+ uint32_t _szidx : 6;
+ };
+
+ struct DictionaryItemDescriptor
+ {
+ lldb::addr_t key_ptr;
+ lldb::addr_t val_ptr;
+ lldb::ValueObjectSP valobj_sp;
+ };
+
+ public:
+ NSDictionaryISyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
+
+ virtual size_t
+ CalculateNumChildren ();
+
+ virtual lldb::ValueObjectSP
+ GetChildAtIndex (size_t idx);
+
+ virtual bool
+ Update();
+
+ virtual bool
+ MightHaveChildren ();
+
+ virtual size_t
+ GetIndexOfChildWithName (const ConstString &name);
+
+ virtual
+ ~NSDictionaryISyntheticFrontEnd ();
+ private:
+ ExecutionContextRef m_exe_ctx_ref;
+ uint8_t m_ptr_size;
+ lldb::ByteOrder m_order;
+ DataDescriptor_32 *m_data_32;
+ DataDescriptor_64 *m_data_64;
+ lldb::addr_t m_data_ptr;
+ ClangASTType m_pair_type;
+ std::vector<DictionaryItemDescriptor> m_children;
+ };
+
+ class NSDictionaryMSyntheticFrontEnd : public SyntheticChildrenFrontEnd
+ {
+ private:
+ struct DataDescriptor_32
+ {
+ uint32_t _used : 26;
+ uint32_t _kvo : 1;
+ uint32_t _size;
+ uint32_t _mutations;
+ uint32_t _objs_addr;
+ uint32_t _keys_addr;
+ };
+ struct DataDescriptor_64
+ {
+ uint64_t _used : 58;
+ uint32_t _kvo : 1;
+ uint64_t _size;
+ uint64_t _mutations;
+ uint64_t _objs_addr;
+ uint64_t _keys_addr;
+ };
+ struct DictionaryItemDescriptor
+ {
+ lldb::addr_t key_ptr;
+ lldb::addr_t val_ptr;
+ lldb::ValueObjectSP valobj_sp;
+ };
+ public:
+ NSDictionaryMSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
+
+ virtual size_t
+ CalculateNumChildren ();
+
+ virtual lldb::ValueObjectSP
+ GetChildAtIndex (size_t idx);
+
+ virtual bool
+ Update();
+
+ virtual bool
+ MightHaveChildren ();
+
+ virtual size_t
+ GetIndexOfChildWithName (const ConstString &name);
+
+ virtual
+ ~NSDictionaryMSyntheticFrontEnd ();
+ private:
+ ExecutionContextRef m_exe_ctx_ref;
+ uint8_t m_ptr_size;
+ lldb::ByteOrder m_order;
+ DataDescriptor_32 *m_data_32;
+ DataDescriptor_64 *m_data_64;
+ ClangASTType m_pair_type;
+ std::vector<DictionaryItemDescriptor> m_children;
+ };
+
+ class NSDictionaryCodeRunningSyntheticFrontEnd : public SyntheticChildrenFrontEnd
+ {
+ public:
+ NSDictionaryCodeRunningSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
+
+ virtual size_t
+ CalculateNumChildren ();
+
+ virtual lldb::ValueObjectSP
+ GetChildAtIndex (size_t idx);
+
+ virtual bool
+ Update();
+
+ virtual bool
+ MightHaveChildren ();
+
+ virtual size_t
+ GetIndexOfChildWithName (const ConstString &name);
+
+ virtual
+ ~NSDictionaryCodeRunningSyntheticFrontEnd ();
+ };
+ }
+}
+
template<bool name_entries>
bool
lldb_private::formatters::NSDictionarySummaryProvider (ValueObject& valobj, Stream& stream)
Modified: lldb/trunk/source/DataFormatters/NSSet.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/NSSet.cpp?rev=220433&r1=220432&r2=220433&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/NSSet.cpp (original)
+++ lldb/trunk/source/DataFormatters/NSSet.cpp Wed Oct 22 16:47:27 2014
@@ -25,6 +25,162 @@ using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::formatters;
+namespace lldb_private {
+ namespace formatters {
+ class NSSetISyntheticFrontEnd : public SyntheticChildrenFrontEnd
+ {
+ private:
+ struct DataDescriptor_32
+ {
+ uint32_t _used : 26;
+ uint32_t _szidx : 6;
+ };
+ struct DataDescriptor_64
+ {
+ uint64_t _used : 58;
+ uint32_t _szidx : 6;
+ };
+
+ struct SetItemDescriptor
+ {
+ lldb::addr_t item_ptr;
+ lldb::ValueObjectSP valobj_sp;
+ };
+
+ public:
+ NSSetISyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
+
+ virtual size_t
+ CalculateNumChildren ();
+
+ virtual lldb::ValueObjectSP
+ GetChildAtIndex (size_t idx);
+
+ virtual bool
+ Update();
+
+ virtual bool
+ MightHaveChildren ();
+
+ virtual size_t
+ GetIndexOfChildWithName (const ConstString &name);
+
+ virtual
+ ~NSSetISyntheticFrontEnd ();
+ private:
+ ExecutionContextRef m_exe_ctx_ref;
+ uint8_t m_ptr_size;
+ DataDescriptor_32 *m_data_32;
+ DataDescriptor_64 *m_data_64;
+ lldb::addr_t m_data_ptr;
+ std::vector<SetItemDescriptor> m_children;
+ };
+
+ class NSOrderedSetSyntheticFrontEnd : public SyntheticChildrenFrontEnd
+ {
+ private:
+
+ public:
+ NSOrderedSetSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
+
+ virtual size_t
+ CalculateNumChildren ();
+
+ virtual lldb::ValueObjectSP
+ GetChildAtIndex (size_t idx);
+
+ virtual bool
+ Update();
+
+ virtual bool
+ MightHaveChildren ();
+
+ virtual size_t
+ GetIndexOfChildWithName (const ConstString &name);
+
+ virtual
+ ~NSOrderedSetSyntheticFrontEnd ();
+ private:
+ uint32_t m_count;
+ std::map<uint32_t,lldb::ValueObjectSP> m_children;
+ };
+
+ class NSSetMSyntheticFrontEnd : public SyntheticChildrenFrontEnd
+ {
+ private:
+ struct DataDescriptor_32
+ {
+ uint32_t _used : 26;
+ uint32_t _size;
+ uint32_t _mutations;
+ uint32_t _objs_addr;
+ };
+ struct DataDescriptor_64
+ {
+ uint64_t _used : 58;
+ uint64_t _size;
+ uint64_t _mutations;
+ uint64_t _objs_addr;
+ };
+ struct SetItemDescriptor
+ {
+ lldb::addr_t item_ptr;
+ lldb::ValueObjectSP valobj_sp;
+ };
+ public:
+ NSSetMSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
+
+ virtual size_t
+ CalculateNumChildren ();
+
+ virtual lldb::ValueObjectSP
+ GetChildAtIndex (size_t idx);
+
+ virtual bool
+ Update();
+
+ virtual bool
+ MightHaveChildren ();
+
+ virtual size_t
+ GetIndexOfChildWithName (const ConstString &name);
+
+ virtual
+ ~NSSetMSyntheticFrontEnd ();
+ private:
+ ExecutionContextRef m_exe_ctx_ref;
+ uint8_t m_ptr_size;
+ DataDescriptor_32 *m_data_32;
+ DataDescriptor_64 *m_data_64;
+ std::vector<SetItemDescriptor> m_children;
+ };
+
+ class NSSetCodeRunningSyntheticFrontEnd : public SyntheticChildrenFrontEnd
+ {
+ public:
+ NSSetCodeRunningSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
+
+ virtual size_t
+ CalculateNumChildren ();
+
+ virtual lldb::ValueObjectSP
+ GetChildAtIndex (size_t idx);
+
+ virtual bool
+ Update();
+
+ virtual bool
+ MightHaveChildren ();
+
+ virtual size_t
+ GetIndexOfChildWithName (const ConstString &name);
+
+ virtual
+ ~NSSetCodeRunningSyntheticFrontEnd ();
+ };
+ }
+}
+
template<bool cf_style>
bool
lldb_private::formatters::NSSetSummaryProvider (ValueObject& valobj, Stream& stream)
More information about the lldb-commits
mailing list