mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-20 03:55:48 -04:00
[Python] Remove dynamic indirection
Now that the Python plugin relies on the SWIG symbols, we no longer need to dynamically resolve these functions. llvm-svn: 357034
This commit is contained in:
parent
330dcd9dab
commit
05495c5d45
@ -142,7 +142,6 @@ llvm::Error SystemInitializerFull::Initialize() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(LLDB_DISABLE_PYTHON)
|
#if !defined(LLDB_DISABLE_PYTHON)
|
||||||
ScriptInterpreterPython::InitializeSWIG();
|
|
||||||
ScriptInterpreterPython::Initialize();
|
ScriptInterpreterPython::Initialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -27,9 +27,6 @@ public:
|
|||||||
|
|
||||||
llvm::Error Initialize() override;
|
llvm::Error Initialize() override;
|
||||||
void Terminate() override;
|
void Terminate() override;
|
||||||
|
|
||||||
private:
|
|
||||||
void InitializeSWIG();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace lldb_private
|
} // namespace lldb_private
|
||||||
|
@ -71,10 +71,9 @@ extern "C" void init_lldb(void);
|
|||||||
#define LLDBSwigPyInit init_lldb
|
#define LLDBSwigPyInit init_lldb
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// these are the Pythonic implementations of the required callbacks these are
|
// These prototypes are the Pythonic implementations of the required callbacks.
|
||||||
// scripting-language specific, which is why they belong here we still need to
|
// Although these are scripting-language specific, their definition depends on
|
||||||
// use function pointers to them instead of relying on linkage-time resolution
|
// the public API.
|
||||||
// because the SWIG stuff and this file get built at different times
|
|
||||||
extern "C" bool LLDBSwigPythonBreakpointCallbackFunction(
|
extern "C" bool LLDBSwigPythonBreakpointCallbackFunction(
|
||||||
const char *python_function_name, const char *session_dictionary_name,
|
const char *python_function_name, const char *session_dictionary_name,
|
||||||
const lldb::StackFrameSP &sb_frame,
|
const lldb::StackFrameSP &sb_frame,
|
||||||
@ -194,67 +193,6 @@ LLDBSWIGPython_GetDynamicSetting(void *module, const char *setting,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ScriptInterpreterPython::SWIGInitCallback
|
|
||||||
ScriptInterpreterPython::g_swig_init_callback = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGBreakpointCallbackFunction
|
|
||||||
ScriptInterpreterPython::g_swig_breakpoint_callback = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGWatchpointCallbackFunction
|
|
||||||
ScriptInterpreterPython::g_swig_watchpoint_callback = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonTypeScriptCallbackFunction
|
|
||||||
ScriptInterpreterPython::g_swig_typescript_callback = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonCreateSyntheticProvider
|
|
||||||
ScriptInterpreterPython::g_swig_synthetic_script = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonCreateCommandObject
|
|
||||||
ScriptInterpreterPython::g_swig_create_cmd = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonCalculateNumChildren
|
|
||||||
ScriptInterpreterPython::g_swig_calc_children = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonGetChildAtIndex
|
|
||||||
ScriptInterpreterPython::g_swig_get_child_index = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonGetIndexOfChildWithName
|
|
||||||
ScriptInterpreterPython::g_swig_get_index_child = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonCastPyObjectToSBValue
|
|
||||||
ScriptInterpreterPython::g_swig_cast_to_sbvalue = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonGetValueObjectSPFromSBValue
|
|
||||||
ScriptInterpreterPython::g_swig_get_valobj_sp_from_sbvalue = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonUpdateSynthProviderInstance
|
|
||||||
ScriptInterpreterPython::g_swig_update_provider = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonMightHaveChildrenSynthProviderInstance
|
|
||||||
ScriptInterpreterPython::g_swig_mighthavechildren_provider = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonGetValueSynthProviderInstance
|
|
||||||
ScriptInterpreterPython::g_swig_getvalue_provider = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonCallCommand
|
|
||||||
ScriptInterpreterPython::g_swig_call_command = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonCallCommandObject
|
|
||||||
ScriptInterpreterPython::g_swig_call_command_object = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonCallModuleInit
|
|
||||||
ScriptInterpreterPython::g_swig_call_module_init = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonCreateOSPlugin
|
|
||||||
ScriptInterpreterPython::g_swig_create_os_plugin = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonCreateFrameRecognizer
|
|
||||||
ScriptInterpreterPython::g_swig_create_frame_recognizer = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonGetRecognizedArguments
|
|
||||||
ScriptInterpreterPython::g_swig_get_recognized_arguments = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonScriptKeyword_Process
|
|
||||||
ScriptInterpreterPython::g_swig_run_script_keyword_process = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonScriptKeyword_Thread
|
|
||||||
ScriptInterpreterPython::g_swig_run_script_keyword_thread = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonScriptKeyword_Target
|
|
||||||
ScriptInterpreterPython::g_swig_run_script_keyword_target = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonScriptKeyword_Frame
|
|
||||||
ScriptInterpreterPython::g_swig_run_script_keyword_frame = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonScriptKeyword_Value
|
|
||||||
ScriptInterpreterPython::g_swig_run_script_keyword_value = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPython_GetDynamicSetting
|
|
||||||
ScriptInterpreterPython::g_swig_plugin_get = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonCreateScriptedThreadPlan
|
|
||||||
ScriptInterpreterPython::g_swig_thread_plan_script = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonCallThreadPlan
|
|
||||||
ScriptInterpreterPython::g_swig_call_thread_plan = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonCreateScriptedBreakpointResolver
|
|
||||||
ScriptInterpreterPython::g_swig_bkpt_resolver_script = nullptr;
|
|
||||||
ScriptInterpreterPython::SWIGPythonCallBreakpointResolver
|
|
||||||
ScriptInterpreterPython::g_swig_call_bkpt_resolver = nullptr;
|
|
||||||
|
|
||||||
static bool g_initialized = false;
|
static bool g_initialized = false;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -276,8 +214,7 @@ public:
|
|||||||
InitializePythonHome();
|
InitializePythonHome();
|
||||||
|
|
||||||
// Register _lldb as a built-in module.
|
// Register _lldb as a built-in module.
|
||||||
PyImport_AppendInittab("_lldb",
|
PyImport_AppendInittab("_lldb", LLDBSwigPyInit);
|
||||||
ScriptInterpreterPython::g_swig_init_callback);
|
|
||||||
|
|
||||||
// Python < 3.2 and Python >= 3.2 reversed the ordering requirements for
|
// Python < 3.2 and Python >= 3.2 reversed the ordering requirements for
|
||||||
// calling `Py_Initialize` and `PyEval_InitThreads`. < 3.2 requires that you
|
// calling `Py_Initialize` and `PyEval_InitThreads`. < 3.2 requires that you
|
||||||
@ -1678,8 +1615,8 @@ StructuredData::GenericSP ScriptInterpreterPython::CreateFrameRecognizer(
|
|||||||
{
|
{
|
||||||
Locker py_lock(this, Locker::AcquireLock | Locker::NoSTDIN,
|
Locker py_lock(this, Locker::AcquireLock | Locker::NoSTDIN,
|
||||||
Locker::FreeLock);
|
Locker::FreeLock);
|
||||||
ret_val =
|
ret_val = LLDBSWIGPython_CreateFrameRecognizer(class_name,
|
||||||
g_swig_create_frame_recognizer(class_name, m_dictionary_name.c_str());
|
m_dictionary_name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
return StructuredData::GenericSP(new StructuredPythonObject(ret_val));
|
return StructuredData::GenericSP(new StructuredPythonObject(ret_val));
|
||||||
@ -1700,9 +1637,9 @@ lldb::ValueObjectListSP ScriptInterpreterPython::GetRecognizedArguments(
|
|||||||
|
|
||||||
if (!implementor.IsAllocated()) return ValueObjectListSP();
|
if (!implementor.IsAllocated()) return ValueObjectListSP();
|
||||||
|
|
||||||
PythonObject py_return(
|
PythonObject py_return(PyRefType::Owned,
|
||||||
PyRefType::Owned,
|
(PyObject *)LLDBSwigPython_GetRecognizedArguments(
|
||||||
(PyObject *)g_swig_get_recognized_arguments(implementor.get(), frame_sp));
|
implementor.get(), frame_sp));
|
||||||
|
|
||||||
// if it fails, print the error but otherwise go on
|
// if it fails, print the error but otherwise go on
|
||||||
if (PyErr_Occurred()) {
|
if (PyErr_Occurred()) {
|
||||||
@ -1715,8 +1652,8 @@ lldb::ValueObjectListSP ScriptInterpreterPython::GetRecognizedArguments(
|
|||||||
for (size_t i = 0; i < result_list.GetSize(); i++) {
|
for (size_t i = 0; i < result_list.GetSize(); i++) {
|
||||||
PyObject *item = result_list.GetItemAtIndex(i).get();
|
PyObject *item = result_list.GetItemAtIndex(i).get();
|
||||||
lldb::SBValue *sb_value_ptr =
|
lldb::SBValue *sb_value_ptr =
|
||||||
(lldb::SBValue *)g_swig_cast_to_sbvalue(item);
|
(lldb::SBValue *)LLDBSWIGPython_CastPyObjectToSBValue(item);
|
||||||
auto valobj_sp = g_swig_get_valobj_sp_from_sbvalue(sb_value_ptr);
|
auto valobj_sp = LLDBSWIGPython_GetValueObjectSPFromSBValue(sb_value_ptr);
|
||||||
if (valobj_sp) result->Append(valobj_sp);
|
if (valobj_sp) result->Append(valobj_sp);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -1737,8 +1674,8 @@ StructuredData::GenericSP ScriptInterpreterPython::OSPlugin_CreatePluginObject(
|
|||||||
{
|
{
|
||||||
Locker py_lock(this, Locker::AcquireLock | Locker::NoSTDIN,
|
Locker py_lock(this, Locker::AcquireLock | Locker::NoSTDIN,
|
||||||
Locker::FreeLock);
|
Locker::FreeLock);
|
||||||
ret_val = g_swig_create_os_plugin(class_name, m_dictionary_name.c_str(),
|
ret_val = LLDBSWIGPythonCreateOSPlugin(
|
||||||
process_sp);
|
class_name, m_dictionary_name.c_str(), process_sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return StructuredData::GenericSP(new StructuredPythonObject(ret_val));
|
return StructuredData::GenericSP(new StructuredPythonObject(ret_val));
|
||||||
@ -2022,7 +1959,7 @@ StructuredData::ObjectSP ScriptInterpreterPython::CreateScriptedThreadPlan(
|
|||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
|
|
||||||
ret_val = g_swig_thread_plan_script(
|
ret_val = LLDBSwigPythonCreateScriptedThreadPlan(
|
||||||
class_name, python_interpreter->m_dictionary_name.c_str(),
|
class_name, python_interpreter->m_dictionary_name.c_str(),
|
||||||
thread_plan_sp);
|
thread_plan_sp);
|
||||||
}
|
}
|
||||||
@ -2039,7 +1976,7 @@ bool ScriptInterpreterPython::ScriptedThreadPlanExplainsStop(
|
|||||||
if (generic) {
|
if (generic) {
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
explains_stop = g_swig_call_thread_plan(
|
explains_stop = LLDBSWIGPythonCallThreadPlan(
|
||||||
generic->GetValue(), "explains_stop", event, script_error);
|
generic->GetValue(), "explains_stop", event, script_error);
|
||||||
if (script_error)
|
if (script_error)
|
||||||
return true;
|
return true;
|
||||||
@ -2056,8 +1993,8 @@ bool ScriptInterpreterPython::ScriptedThreadPlanShouldStop(
|
|||||||
if (generic) {
|
if (generic) {
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
should_stop = g_swig_call_thread_plan(generic->GetValue(), "should_stop",
|
should_stop = LLDBSWIGPythonCallThreadPlan(
|
||||||
event, script_error);
|
generic->GetValue(), "should_stop", event, script_error);
|
||||||
if (script_error)
|
if (script_error)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -2073,8 +2010,8 @@ bool ScriptInterpreterPython::ScriptedThreadPlanIsStale(
|
|||||||
if (generic) {
|
if (generic) {
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
is_stale = g_swig_call_thread_plan(generic->GetValue(), "is_stale", nullptr,
|
is_stale = LLDBSWIGPythonCallThreadPlan(generic->GetValue(), "is_stale",
|
||||||
script_error);
|
nullptr, script_error);
|
||||||
if (script_error)
|
if (script_error)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -2090,8 +2027,8 @@ lldb::StateType ScriptInterpreterPython::ScriptedThreadPlanGetRunState(
|
|||||||
if (generic) {
|
if (generic) {
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
should_step = g_swig_call_thread_plan(generic->GetValue(), "should_step",
|
should_step = LLDBSWIGPythonCallThreadPlan(
|
||||||
NULL, script_error);
|
generic->GetValue(), "should_step", NULL, script_error);
|
||||||
if (script_error)
|
if (script_error)
|
||||||
should_step = true;
|
should_step = true;
|
||||||
}
|
}
|
||||||
@ -2128,9 +2065,9 @@ ScriptInterpreterPython::CreateScriptedBreakpointResolver(
|
|||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
|
|
||||||
ret_val = g_swig_bkpt_resolver_script(
|
ret_val = LLDBSwigPythonCreateScriptedBreakpointResolver(
|
||||||
class_name, python_interpreter->m_dictionary_name.c_str(),
|
class_name, python_interpreter->m_dictionary_name.c_str(), args_data,
|
||||||
args_data, bkpt_sp);
|
bkpt_sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return StructuredData::GenericSP(new StructuredPythonObject(ret_val));
|
return StructuredData::GenericSP(new StructuredPythonObject(ret_val));
|
||||||
@ -2145,9 +2082,8 @@ ScriptInterpreterPython::ScriptedBreakpointResolverSearchCallback(
|
|||||||
if (implementor_sp) {
|
if (implementor_sp) {
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
should_continue
|
should_continue = LLDBSwigPythonCallBreakpointResolver(
|
||||||
= g_swig_call_bkpt_resolver(implementor_sp->GetValue(), "__callback__",
|
implementor_sp->GetValue(), "__callback__", sym_ctx);
|
||||||
sym_ctx);
|
|
||||||
if (PyErr_Occurred()) {
|
if (PyErr_Occurred()) {
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
@ -2163,8 +2099,8 @@ ScriptInterpreterPython::ScriptedBreakpointResolverSearchDepth(
|
|||||||
if (implementor_sp) {
|
if (implementor_sp) {
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
depth_as_int
|
depth_as_int = LLDBSwigPythonCallBreakpointResolver(
|
||||||
= g_swig_call_bkpt_resolver(implementor_sp->GetValue(), "__get_depth__", nullptr);
|
implementor_sp->GetValue(), "__get_depth__", nullptr);
|
||||||
if (PyErr_Occurred()) {
|
if (PyErr_Occurred()) {
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
@ -2199,8 +2135,7 @@ ScriptInterpreterPython::LoadPluginModule(const FileSpec &file_spec,
|
|||||||
StructuredData::DictionarySP ScriptInterpreterPython::GetDynamicSettings(
|
StructuredData::DictionarySP ScriptInterpreterPython::GetDynamicSettings(
|
||||||
StructuredData::ObjectSP plugin_module_sp, Target *target,
|
StructuredData::ObjectSP plugin_module_sp, Target *target,
|
||||||
const char *setting_name, lldb_private::Status &error) {
|
const char *setting_name, lldb_private::Status &error) {
|
||||||
if (!plugin_module_sp || !target || !setting_name || !setting_name[0] ||
|
if (!plugin_module_sp || !target || !setting_name || !setting_name[0])
|
||||||
!g_swig_plugin_get)
|
|
||||||
return StructuredData::DictionarySP();
|
return StructuredData::DictionarySP();
|
||||||
StructuredData::Generic *generic = plugin_module_sp->GetAsGeneric();
|
StructuredData::Generic *generic = plugin_module_sp->GetAsGeneric();
|
||||||
if (!generic)
|
if (!generic)
|
||||||
@ -2211,8 +2146,8 @@ StructuredData::DictionarySP ScriptInterpreterPython::GetDynamicSettings(
|
|||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
TargetSP target_sp(target->shared_from_this());
|
TargetSP target_sp(target->shared_from_this());
|
||||||
reply_pyobj.Reset(PyRefType::Owned,
|
reply_pyobj.Reset(PyRefType::Owned,
|
||||||
(PyObject *)g_swig_plugin_get(generic->GetValue(),
|
(PyObject *)LLDBSWIGPython_GetDynamicSetting(
|
||||||
setting_name, target_sp));
|
generic->GetValue(), setting_name, target_sp));
|
||||||
|
|
||||||
PythonDictionary py_dict(PyRefType::Borrowed, reply_pyobj.get());
|
PythonDictionary py_dict(PyRefType::Borrowed, reply_pyobj.get());
|
||||||
return py_dict.CreateStructuredDictionary();
|
return py_dict.CreateStructuredDictionary();
|
||||||
@ -2247,7 +2182,7 @@ ScriptInterpreterPython::CreateSyntheticScriptedProvider(
|
|||||||
{
|
{
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
ret_val = g_swig_synthetic_script(
|
ret_val = LLDBSwigPythonCreateSyntheticProvider(
|
||||||
class_name, python_interpreter->m_dictionary_name.c_str(), valobj);
|
class_name, python_interpreter->m_dictionary_name.c_str(), valobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2270,8 +2205,8 @@ ScriptInterpreterPython::CreateScriptCommandObject(const char *class_name) {
|
|||||||
{
|
{
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
ret_val =
|
ret_val = LLDBSwigPythonCreateCommandObject(
|
||||||
g_swig_create_cmd(class_name, m_dictionary_name.c_str(), debugger_sp);
|
class_name, m_dictionary_name.c_str(), debugger_sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return StructuredData::GenericSP(new StructuredPythonObject(ret_val));
|
return StructuredData::GenericSP(new StructuredPythonObject(ret_val));
|
||||||
@ -2369,9 +2304,9 @@ bool ScriptInterpreterPython::GetScriptedSummary(
|
|||||||
{
|
{
|
||||||
TypeSummaryOptionsSP options_sp(new TypeSummaryOptions(options));
|
TypeSummaryOptionsSP options_sp(new TypeSummaryOptions(options));
|
||||||
|
|
||||||
static Timer::Category func_cat("g_swig_typescript_callback");
|
static Timer::Category func_cat("LLDBSwigPythonCallTypeScript");
|
||||||
Timer scoped_timer(func_cat, "g_swig_typescript_callback");
|
Timer scoped_timer(func_cat, "LLDBSwigPythonCallTypeScript");
|
||||||
ret_val = g_swig_typescript_callback(
|
ret_val = LLDBSwigPythonCallTypeScript(
|
||||||
python_function_name, GetSessionDictionary().get(), valobj,
|
python_function_name, GetSessionDictionary().get(), valobj,
|
||||||
&new_callee, options_sp, retval);
|
&new_callee, options_sp, retval);
|
||||||
}
|
}
|
||||||
@ -2437,7 +2372,7 @@ bool ScriptInterpreterPython::BreakpointCallbackFunction(
|
|||||||
Locker py_lock(python_interpreter, Locker::AcquireLock |
|
Locker py_lock(python_interpreter, Locker::AcquireLock |
|
||||||
Locker::InitSession |
|
Locker::InitSession |
|
||||||
Locker::NoSTDIN);
|
Locker::NoSTDIN);
|
||||||
ret_val = g_swig_breakpoint_callback(
|
ret_val = LLDBSwigPythonBreakpointCallbackFunction(
|
||||||
python_function_name,
|
python_function_name,
|
||||||
python_interpreter->m_dictionary_name.c_str(), stop_frame_sp,
|
python_interpreter->m_dictionary_name.c_str(), stop_frame_sp,
|
||||||
bp_loc_sp);
|
bp_loc_sp);
|
||||||
@ -2485,7 +2420,7 @@ bool ScriptInterpreterPython::WatchpointCallbackFunction(
|
|||||||
Locker py_lock(python_interpreter, Locker::AcquireLock |
|
Locker py_lock(python_interpreter, Locker::AcquireLock |
|
||||||
Locker::InitSession |
|
Locker::InitSession |
|
||||||
Locker::NoSTDIN);
|
Locker::NoSTDIN);
|
||||||
ret_val = g_swig_watchpoint_callback(
|
ret_val = LLDBSwigPythonWatchpointCallbackFunction(
|
||||||
python_function_name,
|
python_function_name,
|
||||||
python_interpreter->m_dictionary_name.c_str(), stop_frame_sp,
|
python_interpreter->m_dictionary_name.c_str(), stop_frame_sp,
|
||||||
wp_sp);
|
wp_sp);
|
||||||
@ -2510,15 +2445,12 @@ size_t ScriptInterpreterPython::CalculateNumChildren(
|
|||||||
if (!implementor)
|
if (!implementor)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!g_swig_calc_children)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
size_t ret_val = 0;
|
size_t ret_val = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
ret_val = g_swig_calc_children(implementor, max);
|
ret_val = LLDBSwigPython_CalculateNumChildren(implementor, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret_val;
|
return ret_val;
|
||||||
@ -2536,22 +2468,19 @@ lldb::ValueObjectSP ScriptInterpreterPython::GetChildAtIndex(
|
|||||||
if (!implementor)
|
if (!implementor)
|
||||||
return lldb::ValueObjectSP();
|
return lldb::ValueObjectSP();
|
||||||
|
|
||||||
if (!g_swig_get_child_index || !g_swig_cast_to_sbvalue)
|
|
||||||
return lldb::ValueObjectSP();
|
|
||||||
|
|
||||||
lldb::ValueObjectSP ret_val;
|
lldb::ValueObjectSP ret_val;
|
||||||
|
|
||||||
{
|
{
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
void *child_ptr = g_swig_get_child_index(implementor, idx);
|
void *child_ptr = LLDBSwigPython_GetChildAtIndex(implementor, idx);
|
||||||
if (child_ptr != nullptr && child_ptr != Py_None) {
|
if (child_ptr != nullptr && child_ptr != Py_None) {
|
||||||
lldb::SBValue *sb_value_ptr =
|
lldb::SBValue *sb_value_ptr =
|
||||||
(lldb::SBValue *)g_swig_cast_to_sbvalue(child_ptr);
|
(lldb::SBValue *)LLDBSWIGPython_CastPyObjectToSBValue(child_ptr);
|
||||||
if (sb_value_ptr == nullptr)
|
if (sb_value_ptr == nullptr)
|
||||||
Py_XDECREF(child_ptr);
|
Py_XDECREF(child_ptr);
|
||||||
else
|
else
|
||||||
ret_val = g_swig_get_valobj_sp_from_sbvalue(sb_value_ptr);
|
ret_val = LLDBSWIGPython_GetValueObjectSPFromSBValue(sb_value_ptr);
|
||||||
} else {
|
} else {
|
||||||
Py_XDECREF(child_ptr);
|
Py_XDECREF(child_ptr);
|
||||||
}
|
}
|
||||||
@ -2572,15 +2501,12 @@ int ScriptInterpreterPython::GetIndexOfChildWithName(
|
|||||||
if (!implementor)
|
if (!implementor)
|
||||||
return UINT32_MAX;
|
return UINT32_MAX;
|
||||||
|
|
||||||
if (!g_swig_get_index_child)
|
|
||||||
return UINT32_MAX;
|
|
||||||
|
|
||||||
int ret_val = UINT32_MAX;
|
int ret_val = UINT32_MAX;
|
||||||
|
|
||||||
{
|
{
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
ret_val = g_swig_get_index_child(implementor, child_name);
|
ret_val = LLDBSwigPython_GetIndexOfChildWithName(implementor, child_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret_val;
|
return ret_val;
|
||||||
@ -2600,13 +2526,10 @@ bool ScriptInterpreterPython::UpdateSynthProviderInstance(
|
|||||||
if (!implementor)
|
if (!implementor)
|
||||||
return ret_val;
|
return ret_val;
|
||||||
|
|
||||||
if (!g_swig_update_provider)
|
|
||||||
return ret_val;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
ret_val = g_swig_update_provider(implementor);
|
ret_val = LLDBSwigPython_UpdateSynthProviderInstance(implementor);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret_val;
|
return ret_val;
|
||||||
@ -2626,13 +2549,12 @@ bool ScriptInterpreterPython::MightHaveChildrenSynthProviderInstance(
|
|||||||
if (!implementor)
|
if (!implementor)
|
||||||
return ret_val;
|
return ret_val;
|
||||||
|
|
||||||
if (!g_swig_mighthavechildren_provider)
|
|
||||||
return ret_val;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
ret_val = g_swig_mighthavechildren_provider(implementor);
|
ret_val =
|
||||||
|
LLDBSwigPython_MightHaveChildrenSynthProviderInstance(implementor);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret_val;
|
return ret_val;
|
||||||
@ -2652,21 +2574,17 @@ lldb::ValueObjectSP ScriptInterpreterPython::GetSyntheticValue(
|
|||||||
if (!implementor)
|
if (!implementor)
|
||||||
return ret_val;
|
return ret_val;
|
||||||
|
|
||||||
if (!g_swig_getvalue_provider || !g_swig_cast_to_sbvalue ||
|
|
||||||
!g_swig_get_valobj_sp_from_sbvalue)
|
|
||||||
return ret_val;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
void *child_ptr = g_swig_getvalue_provider(implementor);
|
void *child_ptr = LLDBSwigPython_GetValueSynthProviderInstance(implementor);
|
||||||
if (child_ptr != nullptr && child_ptr != Py_None) {
|
if (child_ptr != nullptr && child_ptr != Py_None) {
|
||||||
lldb::SBValue *sb_value_ptr =
|
lldb::SBValue *sb_value_ptr =
|
||||||
(lldb::SBValue *)g_swig_cast_to_sbvalue(child_ptr);
|
(lldb::SBValue *)LLDBSWIGPython_CastPyObjectToSBValue(child_ptr);
|
||||||
if (sb_value_ptr == nullptr)
|
if (sb_value_ptr == nullptr)
|
||||||
Py_XDECREF(child_ptr);
|
Py_XDECREF(child_ptr);
|
||||||
else
|
else
|
||||||
ret_val = g_swig_get_valobj_sp_from_sbvalue(sb_value_ptr);
|
ret_val = LLDBSWIGPython_GetValueObjectSPFromSBValue(sb_value_ptr);
|
||||||
} else {
|
} else {
|
||||||
Py_XDECREF(child_ptr);
|
Py_XDECREF(child_ptr);
|
||||||
}
|
}
|
||||||
@ -2754,15 +2672,12 @@ bool ScriptInterpreterPython::RunScriptFormatKeyword(const char *impl_function,
|
|||||||
error.SetErrorString("no function to execute");
|
error.SetErrorString("no function to execute");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!g_swig_run_script_keyword_process) {
|
|
||||||
error.SetErrorString("internal helper function missing");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
ProcessSP process_sp(process->shared_from_this());
|
ProcessSP process_sp(process->shared_from_this());
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
ret_val = g_swig_run_script_keyword_process(
|
ret_val = LLDBSWIGPythonRunScriptKeywordProcess(
|
||||||
impl_function, m_dictionary_name.c_str(), process_sp, output);
|
impl_function, m_dictionary_name.c_str(), process_sp, output);
|
||||||
if (!ret_val)
|
if (!ret_val)
|
||||||
error.SetErrorString("python script evaluation failed");
|
error.SetErrorString("python script evaluation failed");
|
||||||
@ -2783,15 +2698,12 @@ bool ScriptInterpreterPython::RunScriptFormatKeyword(const char *impl_function,
|
|||||||
error.SetErrorString("no function to execute");
|
error.SetErrorString("no function to execute");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!g_swig_run_script_keyword_thread) {
|
|
||||||
error.SetErrorString("internal helper function missing");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
ThreadSP thread_sp(thread->shared_from_this());
|
ThreadSP thread_sp(thread->shared_from_this());
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
ret_val = g_swig_run_script_keyword_thread(
|
ret_val = LLDBSWIGPythonRunScriptKeywordThread(
|
||||||
impl_function, m_dictionary_name.c_str(), thread_sp, output);
|
impl_function, m_dictionary_name.c_str(), thread_sp, output);
|
||||||
if (!ret_val)
|
if (!ret_val)
|
||||||
error.SetErrorString("python script evaluation failed");
|
error.SetErrorString("python script evaluation failed");
|
||||||
@ -2812,15 +2724,12 @@ bool ScriptInterpreterPython::RunScriptFormatKeyword(const char *impl_function,
|
|||||||
error.SetErrorString("no function to execute");
|
error.SetErrorString("no function to execute");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!g_swig_run_script_keyword_target) {
|
|
||||||
error.SetErrorString("internal helper function missing");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
TargetSP target_sp(target->shared_from_this());
|
TargetSP target_sp(target->shared_from_this());
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
ret_val = g_swig_run_script_keyword_target(
|
ret_val = LLDBSWIGPythonRunScriptKeywordTarget(
|
||||||
impl_function, m_dictionary_name.c_str(), target_sp, output);
|
impl_function, m_dictionary_name.c_str(), target_sp, output);
|
||||||
if (!ret_val)
|
if (!ret_val)
|
||||||
error.SetErrorString("python script evaluation failed");
|
error.SetErrorString("python script evaluation failed");
|
||||||
@ -2841,15 +2750,12 @@ bool ScriptInterpreterPython::RunScriptFormatKeyword(const char *impl_function,
|
|||||||
error.SetErrorString("no function to execute");
|
error.SetErrorString("no function to execute");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!g_swig_run_script_keyword_frame) {
|
|
||||||
error.SetErrorString("internal helper function missing");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
StackFrameSP frame_sp(frame->shared_from_this());
|
StackFrameSP frame_sp(frame->shared_from_this());
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
ret_val = g_swig_run_script_keyword_frame(
|
ret_val = LLDBSWIGPythonRunScriptKeywordFrame(
|
||||||
impl_function, m_dictionary_name.c_str(), frame_sp, output);
|
impl_function, m_dictionary_name.c_str(), frame_sp, output);
|
||||||
if (!ret_val)
|
if (!ret_val)
|
||||||
error.SetErrorString("python script evaluation failed");
|
error.SetErrorString("python script evaluation failed");
|
||||||
@ -2870,15 +2776,12 @@ bool ScriptInterpreterPython::RunScriptFormatKeyword(const char *impl_function,
|
|||||||
error.SetErrorString("no function to execute");
|
error.SetErrorString("no function to execute");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!g_swig_run_script_keyword_value) {
|
|
||||||
error.SetErrorString("internal helper function missing");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
ValueObjectSP value_sp(value->GetSP());
|
ValueObjectSP value_sp(value->GetSP());
|
||||||
Locker py_lock(this,
|
Locker py_lock(this,
|
||||||
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
|
||||||
ret_val = g_swig_run_script_keyword_value(
|
ret_val = LLDBSWIGPythonRunScriptKeywordValue(
|
||||||
impl_function, m_dictionary_name.c_str(), value_sp, output);
|
impl_function, m_dictionary_name.c_str(), value_sp, output);
|
||||||
if (!ret_val)
|
if (!ret_val)
|
||||||
error.SetErrorString("python script evaluation failed");
|
error.SetErrorString("python script evaluation failed");
|
||||||
@ -2906,11 +2809,6 @@ bool ScriptInterpreterPython::LoadScriptingModule(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_swig_call_module_init) {
|
|
||||||
error.SetErrorString("internal helper function missing");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
lldb::DebuggerSP debugger_sp = m_interpreter.GetDebugger().shared_from_this();
|
lldb::DebuggerSP debugger_sp = m_interpreter.GetDebugger().shared_from_this();
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -3030,8 +2928,8 @@ bool ScriptInterpreterPython::LoadScriptingModule(
|
|||||||
|
|
||||||
// if we are here, everything worked
|
// if we are here, everything worked
|
||||||
// call __lldb_init_module(debugger,dict)
|
// call __lldb_init_module(debugger,dict)
|
||||||
if (!g_swig_call_module_init(basename.c_str(), m_dictionary_name.c_str(),
|
if (!LLDBSwigPythonCallModuleInit(basename.c_str(),
|
||||||
debugger_sp)) {
|
m_dictionary_name.c_str(), debugger_sp)) {
|
||||||
error.SetErrorString("calling __lldb_init_module failed");
|
error.SetErrorString("calling __lldb_init_module failed");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -3103,11 +3001,6 @@ bool ScriptInterpreterPython::RunScriptBasedCommand(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_swig_call_command) {
|
|
||||||
error.SetErrorString("no helper function to run scripted commands");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
lldb::DebuggerSP debugger_sp = m_interpreter.GetDebugger().shared_from_this();
|
lldb::DebuggerSP debugger_sp = m_interpreter.GetDebugger().shared_from_this();
|
||||||
lldb::ExecutionContextRefSP exe_ctx_ref_sp(new ExecutionContextRef(exe_ctx));
|
lldb::ExecutionContextRefSP exe_ctx_ref_sp(new ExecutionContextRef(exe_ctx));
|
||||||
|
|
||||||
@ -3129,9 +3022,9 @@ bool ScriptInterpreterPython::RunScriptBasedCommand(
|
|||||||
SynchronicityHandler synch_handler(debugger_sp, synchronicity);
|
SynchronicityHandler synch_handler(debugger_sp, synchronicity);
|
||||||
|
|
||||||
std::string args_str = args.str();
|
std::string args_str = args.str();
|
||||||
ret_val = g_swig_call_command(impl_function, m_dictionary_name.c_str(),
|
ret_val = LLDBSwigPythonCallCommand(
|
||||||
debugger_sp, args_str.c_str(), cmd_retobj,
|
impl_function, m_dictionary_name.c_str(), debugger_sp, args_str.c_str(),
|
||||||
exe_ctx_ref_sp);
|
cmd_retobj, exe_ctx_ref_sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ret_val)
|
if (!ret_val)
|
||||||
@ -3152,11 +3045,6 @@ bool ScriptInterpreterPython::RunScriptBasedCommand(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_swig_call_command_object) {
|
|
||||||
error.SetErrorString("no helper function to run scripted commands");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
lldb::DebuggerSP debugger_sp = m_interpreter.GetDebugger().shared_from_this();
|
lldb::DebuggerSP debugger_sp = m_interpreter.GetDebugger().shared_from_this();
|
||||||
lldb::ExecutionContextRefSP exe_ctx_ref_sp(new ExecutionContextRef(exe_ctx));
|
lldb::ExecutionContextRefSP exe_ctx_ref_sp(new ExecutionContextRef(exe_ctx));
|
||||||
|
|
||||||
@ -3178,9 +3066,9 @@ bool ScriptInterpreterPython::RunScriptBasedCommand(
|
|||||||
SynchronicityHandler synch_handler(debugger_sp, synchronicity);
|
SynchronicityHandler synch_handler(debugger_sp, synchronicity);
|
||||||
|
|
||||||
std::string args_str = args.str();
|
std::string args_str = args.str();
|
||||||
ret_val = g_swig_call_command_object(impl_obj_sp->GetValue(), debugger_sp,
|
ret_val = LLDBSwigPythonCallCommandObject(impl_obj_sp->GetValue(),
|
||||||
args_str.c_str(), cmd_retobj,
|
debugger_sp, args_str.c_str(),
|
||||||
exe_ctx_ref_sp);
|
cmd_retobj, exe_ctx_ref_sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ret_val)
|
if (!ret_val)
|
||||||
@ -3397,96 +3285,6 @@ ScriptInterpreterPython::AcquireInterpreterLock() {
|
|||||||
return py_lock;
|
return py_lock;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptInterpreterPython::InitializeSWIG() {
|
|
||||||
#if !defined(LLDB_DISABLE_PYTHON)
|
|
||||||
InitializeInterpreter(
|
|
||||||
LLDBSwigPyInit, LLDBSwigPythonBreakpointCallbackFunction,
|
|
||||||
LLDBSwigPythonWatchpointCallbackFunction, LLDBSwigPythonCallTypeScript,
|
|
||||||
LLDBSwigPythonCreateSyntheticProvider, LLDBSwigPythonCreateCommandObject,
|
|
||||||
LLDBSwigPython_CalculateNumChildren, LLDBSwigPython_GetChildAtIndex,
|
|
||||||
LLDBSwigPython_GetIndexOfChildWithName,
|
|
||||||
LLDBSWIGPython_CastPyObjectToSBValue,
|
|
||||||
LLDBSWIGPython_GetValueObjectSPFromSBValue,
|
|
||||||
LLDBSwigPython_UpdateSynthProviderInstance,
|
|
||||||
LLDBSwigPython_MightHaveChildrenSynthProviderInstance,
|
|
||||||
LLDBSwigPython_GetValueSynthProviderInstance, LLDBSwigPythonCallCommand,
|
|
||||||
LLDBSwigPythonCallCommandObject, LLDBSwigPythonCallModuleInit,
|
|
||||||
LLDBSWIGPythonCreateOSPlugin, LLDBSWIGPython_CreateFrameRecognizer,
|
|
||||||
LLDBSwigPython_GetRecognizedArguments,
|
|
||||||
LLDBSWIGPythonRunScriptKeywordProcess,
|
|
||||||
LLDBSWIGPythonRunScriptKeywordThread,
|
|
||||||
LLDBSWIGPythonRunScriptKeywordTarget, LLDBSWIGPythonRunScriptKeywordFrame,
|
|
||||||
LLDBSWIGPythonRunScriptKeywordValue, LLDBSWIGPython_GetDynamicSetting,
|
|
||||||
LLDBSwigPythonCreateScriptedThreadPlan, LLDBSWIGPythonCallThreadPlan,
|
|
||||||
LLDBSwigPythonCreateScriptedBreakpointResolver,
|
|
||||||
LLDBSwigPythonCallBreakpointResolver);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void ScriptInterpreterPython::InitializeInterpreter(
|
|
||||||
SWIGInitCallback swig_init_callback,
|
|
||||||
SWIGBreakpointCallbackFunction swig_breakpoint_callback,
|
|
||||||
SWIGWatchpointCallbackFunction swig_watchpoint_callback,
|
|
||||||
SWIGPythonTypeScriptCallbackFunction swig_typescript_callback,
|
|
||||||
SWIGPythonCreateSyntheticProvider swig_synthetic_script,
|
|
||||||
SWIGPythonCreateCommandObject swig_create_cmd,
|
|
||||||
SWIGPythonCalculateNumChildren swig_calc_children,
|
|
||||||
SWIGPythonGetChildAtIndex swig_get_child_index,
|
|
||||||
SWIGPythonGetIndexOfChildWithName swig_get_index_child,
|
|
||||||
SWIGPythonCastPyObjectToSBValue swig_cast_to_sbvalue,
|
|
||||||
SWIGPythonGetValueObjectSPFromSBValue swig_get_valobj_sp_from_sbvalue,
|
|
||||||
SWIGPythonUpdateSynthProviderInstance swig_update_provider,
|
|
||||||
SWIGPythonMightHaveChildrenSynthProviderInstance
|
|
||||||
swig_mighthavechildren_provider,
|
|
||||||
SWIGPythonGetValueSynthProviderInstance swig_getvalue_provider,
|
|
||||||
SWIGPythonCallCommand swig_call_command,
|
|
||||||
SWIGPythonCallCommandObject swig_call_command_object,
|
|
||||||
SWIGPythonCallModuleInit swig_call_module_init,
|
|
||||||
SWIGPythonCreateOSPlugin swig_create_os_plugin,
|
|
||||||
SWIGPythonCreateFrameRecognizer swig_create_frame_recognizer,
|
|
||||||
SWIGPythonGetRecognizedArguments swig_get_recognized_arguments,
|
|
||||||
SWIGPythonScriptKeyword_Process swig_run_script_keyword_process,
|
|
||||||
SWIGPythonScriptKeyword_Thread swig_run_script_keyword_thread,
|
|
||||||
SWIGPythonScriptKeyword_Target swig_run_script_keyword_target,
|
|
||||||
SWIGPythonScriptKeyword_Frame swig_run_script_keyword_frame,
|
|
||||||
SWIGPythonScriptKeyword_Value swig_run_script_keyword_value,
|
|
||||||
SWIGPython_GetDynamicSetting swig_plugin_get,
|
|
||||||
SWIGPythonCreateScriptedThreadPlan swig_thread_plan_script,
|
|
||||||
SWIGPythonCallThreadPlan swig_call_thread_plan,
|
|
||||||
SWIGPythonCreateScriptedBreakpointResolver swig_bkpt_resolver_script,
|
|
||||||
SWIGPythonCallBreakpointResolver swig_call_bkpt_resolver) {
|
|
||||||
g_swig_init_callback = swig_init_callback;
|
|
||||||
g_swig_breakpoint_callback = swig_breakpoint_callback;
|
|
||||||
g_swig_watchpoint_callback = swig_watchpoint_callback;
|
|
||||||
g_swig_typescript_callback = swig_typescript_callback;
|
|
||||||
g_swig_synthetic_script = swig_synthetic_script;
|
|
||||||
g_swig_create_cmd = swig_create_cmd;
|
|
||||||
g_swig_calc_children = swig_calc_children;
|
|
||||||
g_swig_get_child_index = swig_get_child_index;
|
|
||||||
g_swig_get_index_child = swig_get_index_child;
|
|
||||||
g_swig_cast_to_sbvalue = swig_cast_to_sbvalue;
|
|
||||||
g_swig_get_valobj_sp_from_sbvalue = swig_get_valobj_sp_from_sbvalue;
|
|
||||||
g_swig_update_provider = swig_update_provider;
|
|
||||||
g_swig_mighthavechildren_provider = swig_mighthavechildren_provider;
|
|
||||||
g_swig_getvalue_provider = swig_getvalue_provider;
|
|
||||||
g_swig_call_command = swig_call_command;
|
|
||||||
g_swig_call_command_object = swig_call_command_object;
|
|
||||||
g_swig_call_module_init = swig_call_module_init;
|
|
||||||
g_swig_create_os_plugin = swig_create_os_plugin;
|
|
||||||
g_swig_create_frame_recognizer = swig_create_frame_recognizer;
|
|
||||||
g_swig_get_recognized_arguments = swig_get_recognized_arguments;
|
|
||||||
g_swig_run_script_keyword_process = swig_run_script_keyword_process;
|
|
||||||
g_swig_run_script_keyword_thread = swig_run_script_keyword_thread;
|
|
||||||
g_swig_run_script_keyword_target = swig_run_script_keyword_target;
|
|
||||||
g_swig_run_script_keyword_frame = swig_run_script_keyword_frame;
|
|
||||||
g_swig_run_script_keyword_value = swig_run_script_keyword_value;
|
|
||||||
g_swig_plugin_get = swig_plugin_get;
|
|
||||||
g_swig_thread_plan_script = swig_thread_plan_script;
|
|
||||||
g_swig_call_thread_plan = swig_call_thread_plan;
|
|
||||||
g_swig_bkpt_resolver_script = swig_bkpt_resolver_script;
|
|
||||||
g_swig_call_bkpt_resolver = swig_call_bkpt_resolver;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ScriptInterpreterPython::InitializePrivate() {
|
void ScriptInterpreterPython::InitializePrivate() {
|
||||||
if (g_initialized)
|
if (g_initialized)
|
||||||
return;
|
return;
|
||||||
@ -3502,8 +3300,7 @@ void ScriptInterpreterPython::InitializePrivate() {
|
|||||||
// initialization.
|
// initialization.
|
||||||
InitializePythonRAII initialize_guard;
|
InitializePythonRAII initialize_guard;
|
||||||
|
|
||||||
if (g_swig_init_callback)
|
LLDBSwigPyInit();
|
||||||
g_swig_init_callback();
|
|
||||||
|
|
||||||
// Update the path python uses to search for modules to include the current
|
// Update the path python uses to search for modules to include the current
|
||||||
// directory.
|
// directory.
|
||||||
|
@ -304,7 +304,6 @@ public:
|
|||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
// Static Functions
|
// Static Functions
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
static void InitializeSWIG();
|
|
||||||
static void Initialize();
|
static void Initialize();
|
||||||
|
|
||||||
static void Terminate();
|
static void Terminate();
|
||||||
@ -365,156 +364,9 @@ public:
|
|||||||
PyGILState_STATE m_GILState;
|
PyGILState_STATE m_GILState;
|
||||||
};
|
};
|
||||||
|
|
||||||
// FIXME: This is currently used from the InitializePythonRAII. Make this
|
|
||||||
// private when we're able to break the dependency.
|
|
||||||
#if PY_MAJOR_VERSION >= 3
|
|
||||||
typedef PyObject *(*SWIGInitCallback)(void);
|
|
||||||
#else
|
|
||||||
typedef void (*SWIGInitCallback)(void);
|
|
||||||
#endif
|
|
||||||
static SWIGInitCallback g_swig_init_callback;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef bool (*SWIGBreakpointCallbackFunction)(
|
|
||||||
const char *python_function_name, const char *session_dictionary_name,
|
|
||||||
const lldb::StackFrameSP &frame_sp,
|
|
||||||
const lldb::BreakpointLocationSP &bp_loc_sp);
|
|
||||||
|
|
||||||
typedef bool (*SWIGWatchpointCallbackFunction)(
|
|
||||||
const char *python_function_name, const char *session_dictionary_name,
|
|
||||||
const lldb::StackFrameSP &frame_sp, const lldb::WatchpointSP &wp_sp);
|
|
||||||
|
|
||||||
typedef bool (*SWIGPythonTypeScriptCallbackFunction)(
|
|
||||||
const char *python_function_name, void *session_dictionary,
|
|
||||||
const lldb::ValueObjectSP &valobj_sp, void **pyfunct_wrapper,
|
|
||||||
const lldb::TypeSummaryOptionsSP &options, std::string &retval);
|
|
||||||
|
|
||||||
typedef void *(*SWIGPythonCreateSyntheticProvider)(
|
|
||||||
const char *python_class_name, const char *session_dictionary_name,
|
|
||||||
const lldb::ValueObjectSP &valobj_sp);
|
|
||||||
|
|
||||||
typedef void *(*SWIGPythonCreateCommandObject)(
|
|
||||||
const char *python_class_name, const char *session_dictionary_name,
|
|
||||||
const lldb::DebuggerSP debugger_sp);
|
|
||||||
|
|
||||||
typedef void *(*SWIGPythonCreateScriptedThreadPlan)(
|
|
||||||
const char *python_class_name, const char *session_dictionary_name,
|
|
||||||
const lldb::ThreadPlanSP &thread_plan_sp);
|
|
||||||
|
|
||||||
typedef bool (*SWIGPythonCallThreadPlan)(void *implementor,
|
|
||||||
const char *method_name,
|
|
||||||
Event *event_sp, bool &got_error);
|
|
||||||
|
|
||||||
typedef void *(*SWIGPythonCreateScriptedBreakpointResolver)(
|
|
||||||
const char *python_class_name, const char *session_dictionary_name,
|
|
||||||
lldb_private::StructuredDataImpl *args_impl, lldb::BreakpointSP &bkpt_sp);
|
|
||||||
|
|
||||||
typedef unsigned int (*SWIGPythonCallBreakpointResolver)(
|
|
||||||
void *implementor, const char *method_name,
|
|
||||||
lldb_private::SymbolContext *sym_ctx);
|
|
||||||
|
|
||||||
typedef void *(*SWIGPythonCreateOSPlugin)(const char *python_class_name,
|
|
||||||
const char *session_dictionary_name,
|
|
||||||
const lldb::ProcessSP &process_sp);
|
|
||||||
|
|
||||||
typedef void *(*SWIGPythonCreateFrameRecognizer)(
|
|
||||||
const char *python_class_name, const char *session_dictionary_name);
|
|
||||||
|
|
||||||
typedef void *(*SWIGPythonGetRecognizedArguments)(
|
|
||||||
void *implementor, const lldb::StackFrameSP &frame_sp);
|
|
||||||
|
|
||||||
typedef size_t (*SWIGPythonCalculateNumChildren)(void *implementor,
|
|
||||||
uint32_t max);
|
|
||||||
|
|
||||||
typedef void *(*SWIGPythonGetChildAtIndex)(void *implementor, uint32_t idx);
|
|
||||||
|
|
||||||
typedef int (*SWIGPythonGetIndexOfChildWithName)(void *implementor,
|
|
||||||
const char *child_name);
|
|
||||||
|
|
||||||
typedef void *(*SWIGPythonCastPyObjectToSBValue)(void *data);
|
|
||||||
|
|
||||||
typedef lldb::ValueObjectSP (*SWIGPythonGetValueObjectSPFromSBValue)(
|
|
||||||
void *data);
|
|
||||||
|
|
||||||
typedef bool (*SWIGPythonUpdateSynthProviderInstance)(void *data);
|
|
||||||
|
|
||||||
typedef bool (*SWIGPythonMightHaveChildrenSynthProviderInstance)(void *data);
|
|
||||||
|
|
||||||
typedef void *(*SWIGPythonGetValueSynthProviderInstance)(void *implementor);
|
|
||||||
|
|
||||||
typedef bool (*SWIGPythonCallCommand)(
|
|
||||||
const char *python_function_name, const char *session_dictionary_name,
|
|
||||||
lldb::DebuggerSP &debugger, const char *args,
|
|
||||||
lldb_private::CommandReturnObject &cmd_retobj,
|
|
||||||
lldb::ExecutionContextRefSP exe_ctx_ref_sp);
|
|
||||||
|
|
||||||
typedef bool (*SWIGPythonCallCommandObject)(
|
|
||||||
void *implementor, lldb::DebuggerSP &debugger, const char *args,
|
|
||||||
lldb_private::CommandReturnObject &cmd_retobj,
|
|
||||||
lldb::ExecutionContextRefSP exe_ctx_ref_sp);
|
|
||||||
|
|
||||||
typedef bool (*SWIGPythonCallModuleInit)(const char *python_module_name,
|
|
||||||
const char *session_dictionary_name,
|
|
||||||
lldb::DebuggerSP &debugger);
|
|
||||||
|
|
||||||
typedef bool (*SWIGPythonScriptKeyword_Process)(
|
|
||||||
const char *python_function_name, const char *session_dictionary_name,
|
|
||||||
lldb::ProcessSP &process, std::string &output);
|
|
||||||
|
|
||||||
typedef bool (*SWIGPythonScriptKeyword_Thread)(
|
|
||||||
const char *python_function_name, const char *session_dictionary_name,
|
|
||||||
lldb::ThreadSP &thread, std::string &output);
|
|
||||||
|
|
||||||
typedef bool (*SWIGPythonScriptKeyword_Target)(
|
|
||||||
const char *python_function_name, const char *session_dictionary_name,
|
|
||||||
lldb::TargetSP &target, std::string &output);
|
|
||||||
|
|
||||||
typedef bool (*SWIGPythonScriptKeyword_Frame)(
|
|
||||||
const char *python_function_name, const char *session_dictionary_name,
|
|
||||||
lldb::StackFrameSP &frame, std::string &output);
|
|
||||||
|
|
||||||
typedef bool (*SWIGPythonScriptKeyword_Value)(
|
|
||||||
const char *python_function_name, const char *session_dictionary_name,
|
|
||||||
lldb::ValueObjectSP &value, std::string &output);
|
|
||||||
|
|
||||||
typedef void *(*SWIGPython_GetDynamicSetting)(
|
|
||||||
void *module, const char *setting, const lldb::TargetSP &target_sp);
|
|
||||||
|
|
||||||
static void InitializePrivate();
|
static void InitializePrivate();
|
||||||
|
|
||||||
static void InitializeInterpreter(
|
|
||||||
SWIGInitCallback python_swig_init_callback,
|
|
||||||
SWIGBreakpointCallbackFunction swig_breakpoint_callback,
|
|
||||||
SWIGWatchpointCallbackFunction swig_watchpoint_callback,
|
|
||||||
SWIGPythonTypeScriptCallbackFunction swig_typescript_callback,
|
|
||||||
SWIGPythonCreateSyntheticProvider swig_synthetic_script,
|
|
||||||
SWIGPythonCreateCommandObject swig_create_cmd,
|
|
||||||
SWIGPythonCalculateNumChildren swig_calc_children,
|
|
||||||
SWIGPythonGetChildAtIndex swig_get_child_index,
|
|
||||||
SWIGPythonGetIndexOfChildWithName swig_get_index_child,
|
|
||||||
SWIGPythonCastPyObjectToSBValue swig_cast_to_sbvalue,
|
|
||||||
SWIGPythonGetValueObjectSPFromSBValue swig_get_valobj_sp_from_sbvalue,
|
|
||||||
SWIGPythonUpdateSynthProviderInstance swig_update_provider,
|
|
||||||
SWIGPythonMightHaveChildrenSynthProviderInstance
|
|
||||||
swig_mighthavechildren_provider,
|
|
||||||
SWIGPythonGetValueSynthProviderInstance swig_getvalue_provider,
|
|
||||||
SWIGPythonCallCommand swig_call_command,
|
|
||||||
SWIGPythonCallCommandObject swig_call_command_object,
|
|
||||||
SWIGPythonCallModuleInit swig_call_module_init,
|
|
||||||
SWIGPythonCreateOSPlugin swig_create_os_plugin,
|
|
||||||
SWIGPythonCreateFrameRecognizer swig_create_frame_recognizer,
|
|
||||||
SWIGPythonGetRecognizedArguments swig_get_recognized_arguments,
|
|
||||||
SWIGPythonScriptKeyword_Process swig_run_script_keyword_process,
|
|
||||||
SWIGPythonScriptKeyword_Thread swig_run_script_keyword_thread,
|
|
||||||
SWIGPythonScriptKeyword_Target swig_run_script_keyword_target,
|
|
||||||
SWIGPythonScriptKeyword_Frame swig_run_script_keyword_frame,
|
|
||||||
SWIGPythonScriptKeyword_Value swig_run_script_keyword_value,
|
|
||||||
SWIGPython_GetDynamicSetting swig_plugin_get,
|
|
||||||
SWIGPythonCreateScriptedThreadPlan swig_thread_plan_script,
|
|
||||||
SWIGPythonCallThreadPlan swig_call_thread_plan,
|
|
||||||
SWIGPythonCreateScriptedBreakpointResolver swig_bkpt_resolver_script,
|
|
||||||
SWIGPythonCallBreakpointResolver swig_call_breakpoint_resolver);
|
|
||||||
|
|
||||||
class SynchronicityHandler {
|
class SynchronicityHandler {
|
||||||
private:
|
private:
|
||||||
lldb::DebuggerSP m_debugger_sp;
|
lldb::DebuggerSP m_debugger_sp;
|
||||||
@ -587,38 +439,6 @@ protected:
|
|||||||
bool m_valid_session;
|
bool m_valid_session;
|
||||||
uint32_t m_lock_count;
|
uint32_t m_lock_count;
|
||||||
PyThreadState *m_command_thread_state;
|
PyThreadState *m_command_thread_state;
|
||||||
|
|
||||||
static SWIGBreakpointCallbackFunction g_swig_breakpoint_callback;
|
|
||||||
static SWIGWatchpointCallbackFunction g_swig_watchpoint_callback;
|
|
||||||
static SWIGPythonTypeScriptCallbackFunction g_swig_typescript_callback;
|
|
||||||
static SWIGPythonCreateSyntheticProvider g_swig_synthetic_script;
|
|
||||||
static SWIGPythonCreateCommandObject g_swig_create_cmd;
|
|
||||||
static SWIGPythonCalculateNumChildren g_swig_calc_children;
|
|
||||||
static SWIGPythonGetChildAtIndex g_swig_get_child_index;
|
|
||||||
static SWIGPythonGetIndexOfChildWithName g_swig_get_index_child;
|
|
||||||
static SWIGPythonCastPyObjectToSBValue g_swig_cast_to_sbvalue;
|
|
||||||
static SWIGPythonGetValueObjectSPFromSBValue
|
|
||||||
g_swig_get_valobj_sp_from_sbvalue;
|
|
||||||
static SWIGPythonUpdateSynthProviderInstance g_swig_update_provider;
|
|
||||||
static SWIGPythonMightHaveChildrenSynthProviderInstance
|
|
||||||
g_swig_mighthavechildren_provider;
|
|
||||||
static SWIGPythonGetValueSynthProviderInstance g_swig_getvalue_provider;
|
|
||||||
static SWIGPythonCallCommand g_swig_call_command;
|
|
||||||
static SWIGPythonCallCommandObject g_swig_call_command_object;
|
|
||||||
static SWIGPythonCallModuleInit g_swig_call_module_init;
|
|
||||||
static SWIGPythonCreateOSPlugin g_swig_create_os_plugin;
|
|
||||||
static SWIGPythonCreateFrameRecognizer g_swig_create_frame_recognizer;
|
|
||||||
static SWIGPythonGetRecognizedArguments g_swig_get_recognized_arguments;
|
|
||||||
static SWIGPythonScriptKeyword_Process g_swig_run_script_keyword_process;
|
|
||||||
static SWIGPythonScriptKeyword_Thread g_swig_run_script_keyword_thread;
|
|
||||||
static SWIGPythonScriptKeyword_Target g_swig_run_script_keyword_target;
|
|
||||||
static SWIGPythonScriptKeyword_Frame g_swig_run_script_keyword_frame;
|
|
||||||
static SWIGPythonScriptKeyword_Value g_swig_run_script_keyword_value;
|
|
||||||
static SWIGPython_GetDynamicSetting g_swig_plugin_get;
|
|
||||||
static SWIGPythonCreateScriptedThreadPlan g_swig_thread_plan_script;
|
|
||||||
static SWIGPythonCallThreadPlan g_swig_call_thread_plan;
|
|
||||||
static SWIGPythonCreateScriptedBreakpointResolver g_swig_bkpt_resolver_script;
|
|
||||||
static SWIGPythonCallBreakpointResolver g_swig_call_bkpt_resolver;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace lldb_private
|
} // namespace lldb_private
|
||||||
|
Loading…
Reference in New Issue
Block a user