mirror of
https://github.com/intel/llvm.git
synced 2026-01-14 11:57:39 +08:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user