Pass an SBStructuredData to scripted ThreadPlans on use.

This will allow us to write reusable scripted ThreadPlans, since
you can use key/value pairs with known keys in the plan to parametrize
its behavior.

Differential Revision: https://reviews.llvm.org/D68366

llvm-svn: 373675
This commit is contained in:
Jim Ingham
2019-10-03 22:50:18 +00:00
parent 145cdad119
commit 27a14f19c8
22 changed files with 346 additions and 147 deletions

View File

@@ -887,6 +887,23 @@ void PythonCallable::Reset(PyRefType type, PyObject *py_obj) {
PythonObject::Reset(PyRefType::Borrowed, result.get());
}
PythonCallable::ArgInfo PythonCallable::GetNumInitArguments() const {
ArgInfo result = {0, false, false, false};
if (!IsValid())
return result;
PyObject *py_func_obj = m_py_obj;
if (!PyClass_Check(m_py_obj))
return result;
PythonObject __init__ = GetAttributeValue("__init__");
if (__init__.IsValid() ) {
auto __init_callable__ = __init__.AsType<PythonCallable>();
if (__init_callable__.IsValid())
return __init_callable__.GetNumArguments();
}
return result;
}
PythonCallable::ArgInfo PythonCallable::GetNumArguments() const {
ArgInfo result = {0, false, false, false};
if (!IsValid())