summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
index 93513473d30..2fc6c1c64e4 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
@@ -201,6 +201,9 @@ public:
bool
HasAttribute(llvm::StringRef attribute) const;
+ PythonObject
+ GetAttributeValue(llvm::StringRef attribute) const;
+
bool
IsValid() const;
@@ -210,6 +213,14 @@ public:
bool
IsNone() const;
+ template<typename T>
+ T AsType() const
+ {
+ if (!T::Check(m_py_obj))
+ return T();
+ return T(PyRefType::Borrowed, m_py_obj);
+ }
+
StructuredData::ObjectSP CreateStructuredObject() const;
protected:
OpenPOWER on IntegriCloud