summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2012-09-28 23:57:51 +0000
committerEnrico Granata <egranata@apple.com>2012-09-28 23:57:51 +0000
commit21dfcd9d41a1a325cd373bb0fcc0172400e94f44 (patch)
treee3d6b18d99bbc2ef2f718d52972fff54fc6232a5 /lldb/scripts/Python
parentb555a767baf4a1058bc6e4e05acbbee9e55d0e26 (diff)
downloadbcm5719-llvm-21dfcd9d41a1a325cd373bb0fcc0172400e94f44.tar.gz
bcm5719-llvm-21dfcd9d41a1a325cd373bb0fcc0172400e94f44.zip
Implementing plugins that provide commands.
This checkin adds the capability for LLDB to load plugins from external dylibs that can provide new commands It exports an SBCommand class from the public API layer, and a new SBCommandPluginInterface There is a minimal load-only plugin manager built into the debugger, which can be accessed via Debugger::LoadPlugin. Plugins are loaded from two locations at debugger startup (LLDB.framework/Resources/PlugIns and ~/Library/Application Support/LLDB/PlugIns) and more can be (re)loaded via the "plugin load" command For an example of how to make a plugin, refer to the fooplugin.cpp file in examples/plugins/commands Caveats: Currently, the new API objects and features are not exposed via Python. The new commands can only be "parsed" (i.e. not raw) and get their command line via a char** parameter (we do not expose our internal Args object) There is no unloading feature, which can potentially lead to leaks if you overwrite the commands by reloading the same or different plugins There is no API exposed for option parsing, which means you may need to use getopt or roll-your-own llvm-svn: 164865
Diffstat (limited to 'lldb/scripts/Python')
-rwxr-xr-xlldb/scripts/Python/build-swig-Python.sh2
-rw-r--r--lldb/scripts/Python/interface/SBCommandInterpreter.i3
-rw-r--r--lldb/scripts/Python/interface/SBCommandReturnObject.i3
3 files changed, 7 insertions, 1 deletions
diff --git a/lldb/scripts/Python/build-swig-Python.sh b/lldb/scripts/Python/build-swig-Python.sh
index 20547647282..386dde6d342 100755
--- a/lldb/scripts/Python/build-swig-Python.sh
+++ b/lldb/scripts/Python/build-swig-Python.sh
@@ -104,7 +104,7 @@ HEADER_FILES="${SRC_ROOT}/include/lldb/lldb.h"\
" ${SRC_ROOT}/include/lldb/API/SBTypeSynthetic.h"\
" ${SRC_ROOT}/include/lldb/API/SBValue.h"\
" ${SRC_ROOT}/include/lldb/API/SBValueList.h"\
-" ${SRC_ROOT}/include/lldb/API/SBWatchpoint.h"\
+" ${SRC_ROOT}/include/lldb/API/SBWatchpoint.h"
INTERFACE_FILES="${SRC_ROOT}/scripts/Python/interface/SBAddress.i"\
" ${SRC_ROOT}/scripts/Python/interface/SBBlock.i"\
diff --git a/lldb/scripts/Python/interface/SBCommandInterpreter.i b/lldb/scripts/Python/interface/SBCommandInterpreter.i
index 62aaf8c48aa..4cf3d22f5d0 100644
--- a/lldb/scripts/Python/interface/SBCommandInterpreter.i
+++ b/lldb/scripts/Python/interface/SBCommandInterpreter.i
@@ -101,6 +101,9 @@ public:
lldb::SBProcess
GetProcess ();
+
+ lldb::SBDebugger
+ GetDebugger ();
void
SourceInitFileInHomeDirectory (lldb::SBCommandReturnObject &result);
diff --git a/lldb/scripts/Python/interface/SBCommandReturnObject.i b/lldb/scripts/Python/interface/SBCommandReturnObject.i
index aed02eac64b..82c07ee434d 100644
--- a/lldb/scripts/Python/interface/SBCommandReturnObject.i
+++ b/lldb/scripts/Python/interface/SBCommandReturnObject.i
@@ -65,6 +65,9 @@ public:
void
AppendMessage (const char *message);
+ void
+ AppendWarning (const char *message);
+
bool
GetDescription (lldb::SBStream &description);
OpenPOWER on IntegriCloud