reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

tools/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
   73   if (m_py_obj) {
   76       ::PyObject_Print(m_py_obj, file, 0);
   96   if (PythonModule::Check(m_py_obj))
   98   if (PythonList::Check(m_py_obj))
  100   if (PythonTuple::Check(m_py_obj))
  102   if (PythonDictionary::Check(m_py_obj))
  104   if (PythonString::Check(m_py_obj))
  110   if (PythonByteArray::Check(m_py_obj))
  112   if (PythonBoolean::Check(m_py_obj))
  114   if (PythonInteger::Check(m_py_obj))
  116   if (PythonFile::Check(m_py_obj))
  118   if (PythonCallable::Check(m_py_obj))
  124   if (!m_py_obj)
  126   PyObject *repr = PyObject_Repr(m_py_obj);
  133   if (!m_py_obj)
  135   PyObject *str = PyObject_Str(m_py_obj);
  189   return !!PyObject_HasAttr(m_py_obj, py_attr.get());
  197   if (!PyObject_HasAttr(m_py_obj, py_attr.get()))
  201                       PyObject_GetAttr(m_py_obj, py_attr.get()));
  207     return PythonDictionary(PyRefType::Borrowed, m_py_obj)
  210     return PythonBoolean(PyRefType::Borrowed, m_py_obj)
  213     return PythonInteger(PyRefType::Borrowed, m_py_obj)
  216     return PythonList(PyRefType::Borrowed, m_py_obj).CreateStructuredArray();
  218     return PythonString(PyRefType::Borrowed, m_py_obj).CreateStructuredString();
  220     return PythonBytes(PyRefType::Borrowed, m_py_obj).CreateStructuredString();
  222     return PythonByteArray(PyRefType::Borrowed, m_py_obj)
  227     return StructuredData::ObjectSP(new StructuredPythonObject(m_py_obj));
  252   PyBytes_AsStringAndSize(m_py_obj, &c, &size);
  259   return PyBytes_Size(m_py_obj);
  271   PyBytes_AsStringAndSize(m_py_obj, &c, &size);
  294   char *c = PyByteArray_AsString(m_py_obj);
  303   return PyByteArray_Size(m_py_obj);
  384   int r = PyString_AsStringAndSize(m_py_obj, &c, &size);
  401     return PyString_Size(m_py_obj);
  469   if (m_py_obj) {
  470     assert(PyLong_Check(m_py_obj) &&
  474     int64_t result = PyLong_AsLongLongAndOverflow(m_py_obj, &overflow);
  479       const uint64_t uval = PyLong_AsUnsignedLongLong(m_py_obj);
  508   return m_py_obj ? PyObject_IsTrue(m_py_obj) : false;
  508   return m_py_obj ? PyObject_IsTrue(m_py_obj) : false;
  540     return PyList_GET_SIZE(m_py_obj);
  546     return PythonObject(PyRefType::Borrowed, PyList_GetItem(m_py_obj, index));
  555     PyList_SetItem(m_py_obj, index, object.get());
  563     PyList_Append(m_py_obj, object.get());
  589   m_py_obj = PyTuple_New(objects.size());
  600   m_py_obj = PyTuple_New(objects.size());
  619     return PyTuple_GET_SIZE(m_py_obj);
  625     return PythonObject(PyRefType::Borrowed, PyTuple_GetItem(m_py_obj, index));
  634     PyTuple_SetItem(m_py_obj, index, object.get());
  664     return PyDict_Size(m_py_obj);
  670     return PythonList(PyRefType::Owned, PyDict_Keys(m_py_obj));
  692   PyObject *o = PyDict_GetItem(m_py_obj, key.get());
  702   PyObject *o = PyDict_GetItemString(m_py_obj, NullTerminated(key));
  714   int r = PyDict_SetItem(m_py_obj, key.get(), value.get());
  724   int r = PyDict_SetItemString(m_py_obj, NullTerminated(key), value.get());
  776   PyObject *dict = PyModule_GetDict(m_py_obj);
  795   return Retain<PythonDictionary>(PyModule_GetDict(m_py_obj));
  873   PyObject *py_func_obj = m_py_obj;
  926   return PythonObject(PyRefType::Owned, PyObject_CallObject(m_py_obj, nullptr));
  933                       PyObject_CallObject(m_py_obj, arg_tuple.get()));
  940                       PyObject_CallObject(m_py_obj, arg_tuple.get()));
 1379   int fd = PyObject_AsFileDescriptor(m_py_obj);
tools/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
  223     m_py_obj = py_obj;
  228     if (m_py_obj && Py_IsInitialized() && type == PyRefType::Borrowed)
  229       Py_XINCREF(m_py_obj);
  233       : PythonObject(PyRefType::Borrowed, rhs.m_py_obj) {}
  236     m_py_obj = rhs.m_py_obj;
  236     m_py_obj = rhs.m_py_obj;
  237     rhs.m_py_obj = nullptr;
  243     if (m_py_obj && Py_IsInitialized())
  244       Py_DECREF(m_py_obj);
  245     m_py_obj = nullptr;
  249     if (m_py_obj)
  250       _PyObject_Dump(m_py_obj);
  257   PyObject *get() const { return m_py_obj; }
  260     PyObject *result = m_py_obj;
  261     m_py_obj = nullptr;
  267     m_py_obj = std::exchange(other.m_py_obj, nullptr);
  267     m_py_obj = std::exchange(other.m_py_obj, nullptr);
  296   bool IsNone() const { return m_py_obj == Py_None; }
  298   bool IsValid() const { return m_py_obj != nullptr; }
  305     if (!T::Check(m_py_obj))
  307     return T(PyRefType::Borrowed, m_py_obj);
  328         PyObject_CallMethod(m_py_obj, py2_const_cast(name),
  338     PyObject *obj = PyObject_CallFunction(m_py_obj, py2_const_cast(format),
  346     if (!m_py_obj)
  348     PyObject *obj = PyObject_GetAttrString(m_py_obj, NullTerminated(name));
  355     if (!m_py_obj)
  357     int r = PyObject_IsTrue(m_py_obj);
  364     if (!m_py_obj)
  367     long long r = PyLong_AsLongLong(m_py_obj);
  374     if (!m_py_obj || !cls.IsValid())
  376     int r = PyObject_IsInstance(m_py_obj, cls.get());