LLDB mainline
ScriptedSyntheticChildrenPythonInterface.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDSYNTHETICCHILDRENPYTHONINTERFACE_H
10#define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDSYNTHETICCHILDRENPYTHONINTERFACE_H
11
13
15namespace lldb_private {
16
20 public PluginInterface {
21public:
23 ScriptInterpreterPythonImpl &interpreter);
24
25 llvm::Expected<StructuredData::GenericSP>
26 CreatePluginObject(llvm::StringRef class_name, ValueObject &backend) override;
27
28 llvm::SmallVector<AbstractMethodRequirement>
30 // Providers that never expose children (num_children == 0 / has_children ==
31 // False) legitimately don't implement get_child_at_index; LLDB simply
32 // won't call it. Treating any single method as required here is stricter
33 // than the pre-migration behavior and would reject those providers.
34 return {};
35 }
36
37 llvm::SmallVector<llvm::StringLiteral> GetOptionalMethods() const override {
38 return {"num_children", "get_child_index"};
39 }
40
41 llvm::Expected<uint32_t> CalculateNumChildren(uint32_t max) override;
42
43 lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override;
44
45 llvm::Expected<uint32_t> GetIndexOfChildWithName(ConstString name) override;
46
48
49 bool MightHaveChildren() override;
50
52
54
55 static void Initialize();
56
57 static void Terminate();
58
59 static llvm::StringRef GetPluginNameStatic() {
60 return "ScriptedSyntheticChildrenPythonInterface";
61 }
62
63 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
64};
65} // namespace lldb_private
66
67#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDSYNTHETICCHILDRENPYTHONINTERFACE_H
A uniqued constant string class.
Definition ConstString.h:40
ScriptedPythonInterface(ScriptInterpreterPythonImpl &interpreter)
llvm::SmallVector< AbstractMethodRequirement > GetAbstractMethodRequirements() const override
llvm::Expected< StructuredData::GenericSP > CreatePluginObject(llvm::StringRef class_name, ValueObject &backend) override
llvm::SmallVector< llvm::StringLiteral > GetOptionalMethods() const override
Methods a script may legitimately leave out, for which LLDB has a documented answer.
llvm::Expected< uint32_t > GetIndexOfChildWithName(ConstString name) override
A class that represents a running process on the host machine.
ChildCacheState
Specifies if children need to be re-computed after a call to SyntheticChildrenFrontEnd::Update.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP