summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
diff options
context:
space:
mode:
authorSiva Chandra <sivachandra@google.com>2015-10-21 19:28:08 +0000
committerSiva Chandra <sivachandra@google.com>2015-10-21 19:28:08 +0000
commit9ac7a6c51f8643e8a44af41efca0c8c148315bc5 (patch)
tree1f324c41d38d5d3bda6279345a245865e17b3506 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
parentc8a8a5e2aeb82403fd93053bef0124d3e82f186e (diff)
downloadbcm5719-llvm-9ac7a6c51f8643e8a44af41efca0c8c148315bc5.tar.gz
bcm5719-llvm-9ac7a6c51f8643e8a44af41efca0c8c148315bc5.zip
[SBValue] Add a method GetNumChildren(uint32_t max)
Summary: Along with this, support for an optional argument to the "num_children" method of a Python synthetic child provider has also been added. These have been added with the following use case in mind: Synthetic child providers currently have a method "has_children" and "num_children". While the former is good enough to know if there are children, it does not give any insight into how many children there are. Though the latter serves this purpose, calculating the number for children of a data structure could be an O(N) operation if the data structure has N children. The new method added in this change provide a middle ground. One can call GetNumChildren(K) to know if a child exists at an index K which can be as large as the callers tolerance can be. If the caller wants to know about children beyond K, it can make an other call with 2K. If the synthetic child provider maintains state about it counting till K previosly, then the next call is only an O(K) operation. Infact, all calls made progressively with steps of K will be O(K) operations. Reviewers: vharron, clayborg, granata.enrico Subscribers: labath, lldb-commits Differential Revision: http://reviews.llvm.org/D13778 llvm-svn: 250930
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
index 23576658bd9..cdba5829dc0 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
@@ -73,7 +73,7 @@ public:
const char *session_dictionary_name,
const lldb::ProcessSP& process_sp);
- typedef size_t (*SWIGPythonCalculateNumChildren) (void *implementor);
+ typedef size_t (*SWIGPythonCalculateNumChildren) (void *implementor, uint32_t max);
typedef void* (*SWIGPythonGetChildAtIndex) (void *implementor, uint32_t idx);
typedef int (*SWIGPythonGetIndexOfChildWithName) (void *implementor, const char* child_name);
typedef void* (*SWIGPythonCastPyObjectToSBValue) (void* data);
@@ -200,7 +200,7 @@ public:
StructuredData::DictionarySP GetDynamicSettings(StructuredData::ObjectSP plugin_module_sp, Target *target, const char *setting_name,
lldb_private::Error &error) override;
- size_t CalculateNumChildren(const StructuredData::ObjectSP &implementor) override;
+ size_t CalculateNumChildren(const StructuredData::ObjectSP &implementor, uint32_t max) override;
lldb::ValueObjectSP GetChildAtIndex(const StructuredData::ObjectSP &implementor, uint32_t idx) override;
OpenPOWER on IntegriCloud