aboutsummaryrefslogtreecommitdiff
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.h49
1 files changed, 39 insertions, 10 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
index 477a427..beeea4c 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
@@ -69,6 +69,7 @@ enum class PyObjectType
Dictionary,
List,
String,
+ Module,
File
};
@@ -185,15 +186,6 @@ public:
return result;
}
- PyObjectType
- GetObjectType() const;
-
- PythonString
- Repr ();
-
- PythonString
- Str ();
-
PythonObject &
operator=(const PythonObject &other)
{
@@ -201,6 +193,21 @@ public:
return *this;
}
+ PyObjectType
+ GetObjectType() const;
+
+ PythonString
+ Repr() const;
+
+ PythonString
+ Str() const;
+
+ static PythonObject
+ ResolveNameGlobal(llvm::StringRef name);
+
+ PythonObject
+ ResolveName(llvm::StringRef name) const;
+
bool
HasAttribute(llvm::StringRef attribute) const;
@@ -224,7 +231,8 @@ public:
return T(PyRefType::Borrowed, m_py_obj);
}
- StructuredData::ObjectSP CreateStructuredObject() const;
+ StructuredData::ObjectSP
+ CreateStructuredObject() const;
protected:
PyObject* m_py_obj;
@@ -338,6 +346,27 @@ public:
StructuredData::DictionarySP CreateStructuredDictionary() const;
};
+class PythonModule : public PythonObject
+{
+ public:
+ PythonModule();
+ PythonModule(PyRefType type, PyObject *o);
+ PythonModule(const PythonModule &dict);
+
+ ~PythonModule() override;
+
+ static bool Check(PyObject *py_obj);
+
+ static PythonModule MainModule();
+
+ // Bring in the no-argument base class version
+ using PythonObject::Reset;
+
+ void Reset(PyRefType type, PyObject *py_obj) override;
+
+ PythonDictionary GetDictionary() const;
+};
+
class PythonFile : public PythonObject
{
public: