summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/python-wrapper.swig
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-10-14 21:39:38 +0000
committerEnrico Granata <egranata@apple.com>2013-10-14 21:39:38 +0000
commitc0f8ca0e74f85241aafa8291f207ceb7e5dfe22b (patch)
tree1edc04cc96c8f6737494f49c1b7d52d9a51e6ded /lldb/scripts/Python/python-wrapper.swig
parent2453a3d95624f993f345c8f4a8513351e0c8da66 (diff)
downloadbcm5719-llvm-c0f8ca0e74f85241aafa8291f207ceb7e5dfe22b.tar.gz
bcm5719-llvm-c0f8ca0e74f85241aafa8291f207ceb7e5dfe22b.zip
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
Diffstat (limited to 'lldb/scripts/Python/python-wrapper.swig')
-rw-r--r--lldb/scripts/Python/python-wrapper.swig24
1 files changed, 24 insertions, 0 deletions
diff --git a/lldb/scripts/Python/python-wrapper.swig b/lldb/scripts/Python/python-wrapper.swig
index cd133cfa8a2..4ab27a9935e 100644
--- a/lldb/scripts/Python/python-wrapper.swig
+++ b/lldb/scripts/Python/python-wrapper.swig
@@ -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,
OpenPOWER on IntegriCloud