|
LLDB mainline
|
#include <PythonDataObjects.h>
Public Member Functions | |
| PythonObject ()=default | |
| PythonObject (PyRefType type, PyObject *py_obj) | |
| PythonObject (const PythonObject &rhs) | |
| PythonObject (PythonObject &&rhs) | |
| ~PythonObject () | |
| void | Reset () |
| void | Dump (Stream &strm) const |
| PyObject * | get () const |
| PyObject * | release () |
| PythonObject & | operator= (PythonObject other) |
| PyObjectType | GetObjectType () const |
| PythonString | Repr () const |
| PythonString | Str () const |
| PythonObject | ResolveName (llvm::StringRef name) const |
| template<typename T> | |
| T | ResolveName (llvm::StringRef name) const |
| bool | HasAttribute (llvm::StringRef attribute) const |
| PythonObject | GetAttributeValue (llvm::StringRef attribute) const |
| bool | IsNone () const |
| bool | IsValid () const |
| bool | IsAllocated () const |
| operator bool () const | |
| template<typename T> | |
| T | AsType () const |
| StructuredData::ObjectSP | CreateStructuredObject () const |
| template<typename... T> | |
| llvm::Expected< PythonObject > | CallMethod (const char *name, const T &... t) const |
| template<typename... T> | |
| llvm::Expected< PythonObject > | Call (const T &... t) const |
| llvm::Expected< PythonObject > | GetAttribute (const llvm::Twine &name) const |
| llvm::Expected< PythonObject > | GetType () const |
| llvm::Expected< bool > | IsTrue () |
| llvm::Expected< long long > | AsLongLong () const |
| llvm::Expected< unsigned long long > | AsUnsignedLongLong () const |
| llvm::Expected< unsigned long long > | AsModuloUnsignedLongLong () const |
| llvm::Expected< bool > | IsInstance (const PythonObject &cls) |
Static Public Member Functions | |
| static PythonObject | ResolveNameWithDictionary (llvm::StringRef name, const PythonDictionary &dict) |
| template<typename T> | |
| static T | ResolveNameWithDictionary (llvm::StringRef name, const PythonDictionary &dict) |
Protected Attributes | |
| PyObject * | m_py_obj = nullptr |
Definition at line 222 of file PythonDataObjects.h.
|
default |
Referenced by CreateStructuredObject(), GetAttributeValue(), lldb_private::python::PythonList::GetItemAtIndex(), lldb_private::python::PythonTuple::GetItemAtIndex(), lldb_private::python::PythonDictionary::GetItemForKey(), IsInstance(), lldb_private::python::ScopedPythonObject< T >::obj(), lldb_private::python::PythonCallable::operator()(), lldb_private::python::PythonCallable::operator()(), lldb_private::python::PythonCallable::operator()(), operator=(), PythonObject(), PythonObject(), ResolveName(), ResolveNameWithDictionary(), lldb_private::python::ScopedPythonObject< T >::ScopedPythonObject(), lldb_private::python::ScopedPythonObject< T >::ScopedPythonObject(), and lldb_private::python::TypedPythonObject< T >::TypedPythonObject().
|
inline |
Definition at line 226 of file PythonDataObjects.h.
References lldb_private::python::Borrowed, and m_py_obj.
|
inline |
Definition at line 236 of file PythonDataObjects.h.
References lldb_private::python::Borrowed, m_py_obj, and PythonObject().
|
inline |
Definition at line 239 of file PythonDataObjects.h.
References m_py_obj, and PythonObject().
|
inline |
Definition at line 244 of file PythonDataObjects.h.
References Reset().
| Expected< long long > PythonObject::AsLongLong | ( | ) | const |
Definition at line 79 of file PythonDataObjects.cpp.
References lldb_private::python::exception(), m_py_obj, and lldb_private::python::nullDeref().
Referenced by lldb_private::python::PythonInteger::CreateStructuredSignedInteger().
| Expected< unsigned long long > PythonObject::AsModuloUnsignedLongLong | ( | ) | const |
Definition at line 100 of file PythonDataObjects.cpp.
References lldb_private::python::exception(), m_py_obj, and lldb_private::python::nullDeref().
|
inline |
Definition at line 297 of file PythonDataObjects.h.
References lldb_private::python::Borrowed, and m_py_obj.
Referenced by ResolveName(), and ResolveNameWithDictionary().
| Expected< unsigned long long > PythonObject::AsUnsignedLongLong | ( | ) | const |
Definition at line 89 of file PythonDataObjects.cpp.
References lldb_private::python::exception(), m_py_obj, and lldb_private::python::nullDeref().
Referenced by lldb_private::python::PythonInteger::CreateStructuredUnsignedInteger(), and ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::DescriptionLevel >().
|
inline |
Definition at line 318 of file PythonDataObjects.h.
References lldb_private::python::exception(), m_py_obj, lldb_private::python::py2_const_cast(), and lldb_private::python::Take().
|
inline |
Definition at line 306 of file PythonDataObjects.h.
References lldb_private::python::exception(), m_py_obj, lldb_private::python::py2_const_cast(), and lldb_private::python::Take().
Referenced by lldb_private::python::PythonFile::ConvertToFile(), and GetOptionsForPyObject().
| StructuredData::ObjectSP PythonObject::CreateStructuredObject | ( | ) | const |
Definition at line 253 of file PythonDataObjects.cpp.
References lldb_private::python::Boolean, lldb_private::python::Borrowed, lldb_private::python::ByteArray, lldb_private::python::Bytes, lldb_private::python::PythonList::CreateStructuredArray(), lldb_private::python::PythonBoolean::CreateStructuredBoolean(), lldb_private::python::PythonDictionary::CreateStructuredDictionary(), lldb_private::python::PythonInteger::CreateStructuredInteger(), lldb_private::python::PythonByteArray::CreateStructuredString(), lldb_private::python::PythonBytes::CreateStructuredString(), lldb_private::python::PythonString::CreateStructuredString(), lldb_private::python::Dictionary, GetObjectType(), lldb_private::python::Integer, lldb_private::python::List, m_py_obj, lldb_private::python::None, PythonObject(), and lldb_private::python::String.
Referenced by lldb_private::python::PythonList::CreateStructuredArray(), lldb_private::python::PythonTuple::CreateStructuredArray(), lldb_private::python::PythonDictionary::CreateStructuredDictionary(), and lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject().
| void PythonObject::Dump | ( | Stream & | strm | ) | const |
Definition at line 117 of file PythonDataObjects.cpp.
References m_py_obj.
|
inline |
Definition at line 250 of file PythonDataObjects.h.
References m_py_obj.
Referenced by lldb_private::python::PythonList::AppendItem(), lldb_private::ScriptedPythonInterface::ExtractValueFromPythonObject(), GetAttributeValue(), lldb_private::python::PythonDictionary::GetItem(), HasAttribute(), lldb_private::python::PythonDictionary::HasKey(), lldb_private::python::PythonScript::Init(), IsInstance(), lldb_private::python::PythonCallable::operator()(), lldb_private::python::PythonCallable::operator()(), lldb_private::ScriptedPythonInterface::ReverseTransform(), lldb_private::python::runStringMultiLine(), lldb_private::python::runStringOneLine(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::BreakpointSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::DataExtractorSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::StackFrameListSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::StackFrameSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::StreamSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ThreadSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ValueObjectListSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ValueObjectSP >(), ScriptedPythonInterface::ExtractValueFromPythonObject< StructuredData::ArraySP >(), lldb_private::python::PythonDictionary::SetItem(), lldb_private::python::PythonList::SetItemAtIndex(), and lldb_private::python::PythonTuple::SetItemAtIndex().
|
inline |
Definition at line 327 of file PythonDataObjects.h.
References lldb_private::python::exception(), m_py_obj, lldb_private::python::nullDeref(), and lldb_private::python::Take().
| PythonObject PythonObject::GetAttributeValue | ( | llvm::StringRef | attribute | ) | const |
Definition at line 241 of file PythonDataObjects.cpp.
References get(), IsValid(), m_py_obj, lldb_private::python::Owned, and PythonObject().
Referenced by lldb_private::python::PythonCallable::Check(), and ResolveName().
| PyObjectType PythonObject::GetObjectType | ( | ) | const |
Definition at line 143 of file PythonDataObjects.cpp.
References lldb_private::python::Boolean, lldb_private::python::ByteArray, lldb_private::python::Bytes, lldb_private::python::Callable, lldb_private::python::PythonBoolean::Check(), lldb_private::python::PythonByteArray::Check(), lldb_private::python::PythonBytes::Check(), lldb_private::python::PythonCallable::Check(), lldb_private::python::PythonDictionary::Check(), lldb_private::python::PythonFile::Check(), lldb_private::python::PythonInteger::Check(), lldb_private::python::PythonList::Check(), lldb_private::python::PythonModule::Check(), lldb_private::python::PythonString::Check(), lldb_private::python::PythonTuple::Check(), lldb_private::python::Dictionary, lldb_private::python::File, lldb_private::python::Integer, IsAllocated(), lldb_private::python::List, m_py_obj, lldb_private::python::Module, lldb_private::python::None, lldb_private::python::String, lldb_private::python::Tuple, and lldb_private::python::Unknown.
Referenced by CreateStructuredObject().
|
inline |
Definition at line 336 of file PythonDataObjects.h.
References lldb_private::python::exception(), m_py_obj, lldb_private::python::nullDeref(), and lldb_private::python::Take().
| bool PythonObject::HasAttribute | ( | llvm::StringRef | attribute | ) | const |
Definition at line 234 of file PythonDataObjects.cpp.
References get(), IsValid(), and m_py_obj.
Referenced by lldb_private::python::PythonCallable::Check().
|
inline |
Definition at line 293 of file PythonDataObjects.h.
References IsNone(), and IsValid().
Referenced by lldb_private::python::PythonList::AppendItem(), lldb_private::python::PythonCallable::Check(), GetObjectType(), ResolveName(), lldb_private::python::PythonList::SetItemAtIndex(), and lldb_private::python::PythonTuple::SetItemAtIndex().
|
inline |
Definition at line 361 of file PythonDataObjects.h.
References lldb_private::python::exception(), get(), IsValid(), m_py_obj, lldb_private::python::nullDeref(), and PythonObject().
Referenced by lldb_private::python::PythonFile::ConvertToFileForcingUseOfScriptingIOMethods().
|
inline |
Definition at line 289 of file PythonDataObjects.h.
References m_py_obj.
Referenced by IsAllocated(), and operator bool().
|
inline |
Definition at line 345 of file PythonDataObjects.h.
References lldb_private::python::exception(), m_py_obj, and lldb_private::python::nullDeref().
|
inline |
Definition at line 291 of file PythonDataObjects.h.
References m_py_obj.
Referenced by lldb_private::python::PythonList::AppendItem(), lldb_private::python::PythonString::AsUTF8(), lldb_private::python::PythonFile::ConvertToFile(), lldb_private::python::PythonFile::ConvertToFileForcingUseOfScriptingIOMethods(), lldb_private::python::PythonModule::Get(), lldb_private::python::PythonCallable::GetArgInfo(), GetAttributeValue(), lldb_private::python::PythonByteArray::GetBytes(), lldb_private::python::PythonBytes::GetBytes(), lldb_private::python::PythonModule::GetDictionary(), lldb_private::python::PythonDictionary::GetItem(), lldb_private::python::PythonList::GetItemAtIndex(), lldb_private::python::PythonTuple::GetItemAtIndex(), lldb_private::python::PythonDictionary::GetKeys(), lldb_private::python::PythonByteArray::GetSize(), lldb_private::python::PythonBytes::GetSize(), lldb_private::python::PythonDictionary::GetSize(), lldb_private::python::PythonList::GetSize(), lldb_private::python::PythonString::GetSize(), lldb_private::python::PythonTuple::GetSize(), HasAttribute(), lldb_private::python::PythonDictionary::HasKey(), IsAllocated(), IsInstance(), operator bool(), lldb_private::python::PythonTuple::PythonTuple(), lldb_private::python::PythonTuple::PythonTuple(), lldb_private::ScriptedPythonInterface::ReverseTransform(), lldb_private::python::runStringMultiLine(), lldb_private::python::runStringOneLine(), lldb_private::python::PythonDictionary::SetItem(), lldb_private::python::PythonList::SetItemAtIndex(), and lldb_private::python::PythonTuple::SetItemAtIndex().
|
inlineexplicit |
Definition at line 295 of file PythonDataObjects.h.
|
inline |
Definition at line 258 of file PythonDataObjects.h.
References m_py_obj, PythonObject(), and Reset().
Referenced by lldb_private::python::TypedPythonObject< T >::TypedPythonObject().
|
inline |
Definition at line 252 of file PythonDataObjects.h.
References m_py_obj.
Referenced by lldb_private::python::PythonCallable::Check().
| PythonString PythonObject::Repr | ( | ) | const |
Definition at line 172 of file PythonDataObjects.cpp.
References m_py_obj, and lldb_private::python::Owned.
| void PythonObject::Reset | ( | ) |
Definition at line 70 of file PythonDataObjects.cpp.
References m_py_obj.
Referenced by operator=(), lldb_private::python::PythonString::SetString(), and ~PythonObject().
| PythonObject PythonObject::ResolveName | ( | llvm::StringRef | name | ) | const |
Definition at line 206 of file PythonDataObjects.cpp.
References GetAttributeValue(), IsAllocated(), PythonObject(), and ResolveName().
Referenced by ResolveName(), and ResolveNameWithDictionary().
|
inline |
Definition at line 281 of file PythonDataObjects.h.
References AsType(), and ResolveName().
|
static |
Definition at line 191 of file PythonDataObjects.cpp.
References lldb_private::python::PythonDictionary::GetItemForKey(), PythonObject(), and ResolveName().
Referenced by ResolveNameWithDictionary().
|
inlinestatic |
Definition at line 274 of file PythonDataObjects.h.
References AsType(), and ResolveNameWithDictionary().
| PythonString PythonObject::Str | ( | ) | const |
Definition at line 181 of file PythonDataObjects.cpp.
References m_py_obj, and lldb_private::python::Owned.
Referenced by lldb_private::python::PythonDictionary::CreateStructuredDictionary().
|
protected |
Definition at line 371 of file PythonDataObjects.h.
Referenced by lldb_private::python::PythonList::AppendItem(), AsLongLong(), AsModuloUnsignedLongLong(), AsType(), AsUnsignedLongLong(), lldb_private::python::PythonString::AsUTF8(), Call(), CallMethod(), lldb_private::python::PythonFile::ConvertToFile(), lldb_private::python::PythonFile::ConvertToFileForcingUseOfScriptingIOMethods(), CreateStructuredObject(), lldb_private::python::PythonBytes::CreateStructuredString(), Dump(), lldb_private::python::PythonModule::Get(), get(), GetAttribute(), GetAttributeValue(), lldb_private::python::PythonByteArray::GetBytes(), lldb_private::python::PythonBytes::GetBytes(), lldb_private::python::PythonModule::GetDictionary(), lldb_private::python::PythonDictionary::GetItem(), lldb_private::python::PythonList::GetItemAtIndex(), lldb_private::python::PythonTuple::GetItemAtIndex(), lldb_private::python::PythonDictionary::GetKeys(), GetObjectType(), lldb_private::python::PythonByteArray::GetSize(), lldb_private::python::PythonBytes::GetSize(), lldb_private::python::PythonDictionary::GetSize(), lldb_private::python::PythonList::GetSize(), lldb_private::python::PythonString::GetSize(), lldb_private::python::PythonTuple::GetSize(), GetType(), lldb_private::python::PythonBoolean::GetValue(), HasAttribute(), lldb_private::python::PythonDictionary::HasKey(), IsInstance(), IsNone(), IsTrue(), IsValid(), lldb_private::python::PythonCallable::operator()(), lldb_private::python::PythonCallable::operator()(), lldb_private::python::PythonCallable::operator()(), operator=(), PythonObject(), PythonObject(), PythonObject(), lldb_private::python::PythonTuple::PythonTuple(), lldb_private::python::PythonTuple::PythonTuple(), release(), Repr(), Reset(), lldb_private::python::PythonDictionary::SetItem(), lldb_private::python::PythonList::SetItemAtIndex(), lldb_private::python::PythonTuple::SetItemAtIndex(), and Str().