From f3fbd1c0586ff6ec7895991e6c28f61a503c36a8 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 23 Jul 2016 20:50:09 +0000 Subject: Vendor import of lldb release_39 branch r276489: https://llvm.org/svn/llvm-project/lldb/branches/release_39@276489 --- .../ScriptInterpreter/Python/PythonDataObjects.h | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h') diff --git a/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h index 06264b66c283..78245a98d0b8 100644 --- a/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h +++ b/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h @@ -75,6 +75,7 @@ enum class PyObjectType List, String, Bytes, + ByteArray, Module, Callable, Tuple, @@ -293,6 +294,39 @@ public: CreateStructuredString() const; }; +class PythonByteArray : public PythonObject +{ +public: + PythonByteArray(); + explicit PythonByteArray(llvm::ArrayRef bytes); + PythonByteArray(const uint8_t *bytes, size_t length); + PythonByteArray(PyRefType type, PyObject *o); + PythonByteArray(const PythonBytes &object); + + ~PythonByteArray() override; + + static bool + Check(PyObject *py_obj); + + // Bring in the no-argument base class version + using PythonObject::Reset; + + void + Reset(PyRefType type, PyObject *py_obj) override; + + llvm::ArrayRef + GetBytes() const; + + size_t + GetSize() const; + + void + SetBytes(llvm::ArrayRef stringbytes); + + StructuredData::StringSP + CreateStructuredString() const; +}; + class PythonString : public PythonObject { public: @@ -468,6 +502,7 @@ class PythonCallable : public PythonObject public: struct ArgInfo { size_t count; + bool is_bound_method : 1; bool has_varargs : 1; bool has_kwargs : 1; }; @@ -525,6 +560,8 @@ class PythonFile : public PythonObject void Reset(PyRefType type, PyObject *py_obj) override; void Reset(File &file, const char *mode); + static uint32_t GetOptionsFromMode(llvm::StringRef mode); + bool GetUnderlyingFile(File &file) const; }; -- cgit v1.2.3