diff options
author | Jim Ingham <jingham@apple.com> | 2014-04-02 01:04:55 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2014-04-02 01:04:55 +0000 |
commit | d80102e4203691c31314fb3f65c5f91d86dbf06e (patch) | |
tree | 47bf527eebc2300e2d86f96c3c85a1a021f3eac9 /lldb/scripts/Python/interface | |
parent | 3c2b13b25825d0e8cd798e2e1e78b31f2f516d32 (diff) | |
download | bcm5719-llvm-d80102e4203691c31314fb3f65c5f91d86dbf06e.tar.gz bcm5719-llvm-d80102e4203691c31314fb3f65c5f91d86dbf06e.zip |
Add the ability to set python breakpoint commands from the SBBreakpoint & SBBreakpointLocation API's.
You can either provide the function name, or function body text.
Also propagate the compilation error up from where it is checked so we can report compilation errors.
<rdar://problem/9898371>
llvm-svn: 205380
Diffstat (limited to 'lldb/scripts/Python/interface')
-rw-r--r-- | lldb/scripts/Python/interface/SBBreakpoint.i | 22 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBBreakpointLocation.i | 23 |
2 files changed, 44 insertions, 1 deletions
diff --git a/lldb/scripts/Python/interface/SBBreakpoint.i b/lldb/scripts/Python/interface/SBBreakpoint.i index 34274dda8b0..190c9b90dd6 100644 --- a/lldb/scripts/Python/interface/SBBreakpoint.i +++ b/lldb/scripts/Python/interface/SBBreakpoint.i @@ -177,9 +177,29 @@ public: const char * GetQueueName () const; + %feature("docstring", " + //------------------------------------------------------------------ + /// Set the name of the script function to be called when the breakpoint is hit. + //------------------------------------------------------------------ + ") SetScriptCallbackFunction; void - SetCallback (BreakpointHitCallback callback, void *baton); + SetScriptCallbackFunction (const char *callback_function_name); + %feature("docstring", " + //------------------------------------------------------------------ + /// Provide the body for the script function to be called when the breakpoint is hit. + /// The body will be wrapped in a function, which be passed two arguments: + /// 'frame' - which holds the bottom-most SBFrame of the thread that hit the breakpoint + /// 'bpno' - which is the SBBreakpointLocation to which the callback was attached. + /// + /// The error parameter is currently ignored, but will at some point hold the Python + /// compilation diagnostics. + /// Returns true if the body compiles successfully, false if not. + //------------------------------------------------------------------ + ") SetScriptCallbackBody; + SBError + SetScriptCallbackBody (const char *script_body_text); + size_t GetNumResolvedLocations() const; diff --git a/lldb/scripts/Python/interface/SBBreakpointLocation.i b/lldb/scripts/Python/interface/SBBreakpointLocation.i index 8c9b9c78246..a3073538e67 100644 --- a/lldb/scripts/Python/interface/SBBreakpointLocation.i +++ b/lldb/scripts/Python/interface/SBBreakpointLocation.i @@ -70,6 +70,29 @@ public: const char * GetCondition (); + %feature("docstring", " + //------------------------------------------------------------------ + /// Set the callback to the given Python function name. + //------------------------------------------------------------------ + ") SetScriptCallbackFunction; + void + SetScriptCallbackFunction (const char *callback_function_name); + + %feature("docstring", " + //------------------------------------------------------------------ + /// Provide the body for the script function to be called when the breakpoint location is hit. + /// The body will be wrapped in a function, which be passed two arguments: + /// 'frame' - which holds the bottom-most SBFrame of the thread that hit the breakpoint + /// 'bpno' - which is the SBBreakpointLocation to which the callback was attached. + /// + /// The error parameter is currently ignored, but will at some point hold the Python + /// compilation diagnostics. + /// Returns true if the body compiles successfully, false if not. + //------------------------------------------------------------------ + ") SetScriptCallbackBody; + SBError + SetScriptCallbackBody (const char *script_body_text); + void SetThreadID (lldb::tid_t sb_thread_id); |