Add the capability for LLDB to query an arbitrary Python module (passed in as a file path) for target-specific settings

This is implemented by means of a get_dynamic_setting(target, setting_name) function vended by the Python module, which can respond to arbitrary string names with dynamically constructed
settings objects (most likely, some of those that PythonDataObjects supports) for LLDB to parse

This needs to be hooked up to the debugger via some setting to allow users to specify which module will vend the information they want to supply

llvm-svn: 192628
This commit is contained in:
Enrico Granata
2013-10-14 21:39:38 +00:00
parent 2453a3d956
commit c0f8ca0e74
4 changed files with 126 additions and 6 deletions

View File

@@ -713,6 +713,30 @@ LLDBSWIGPythonCreateOSPlugin
Py_RETURN_NONE;
}
SWIGEXPORT void*
LLDBSWIGPython_GDBPluginGetDynamicSetting (void* module, const char* setting, const lldb::TargetSP& target_sp)
{
if (!module || !setting)
Py_RETURN_NONE;
lldb::SBTarget target_sb(target_sp);
PyObject *pvalue = NULL;
{
PyErr_Cleaner py_err_cleaner(true);
PyCallable pfunc = PyCallable::FindWithFunctionName("get_dynamic_setting",(PyObject *)module);
if (!pfunc)
Py_RETURN_NONE;
pvalue = pfunc(target_sb, setting);
}
return pvalue;
}
SWIGEXPORT bool
LLDBSWIGPythonRunScriptKeywordProcess
(const char* python_function_name,