summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2019-10-25 14:05:07 -0700
committerJim Ingham <jingham@apple.com>2019-10-25 14:05:07 -0700
commit738af7a6241c98164625b9cd1ba9f8af4e36f197 (patch)
tree35ecaeb5e79f0fe728c25e82157831b26c3f7158 /lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
parenta6b0219fc4a78e96ff268d101b911466dedbbf2c (diff)
downloadbcm5719-llvm-738af7a6241c98164625b9cd1ba9f8af4e36f197.tar.gz
bcm5719-llvm-738af7a6241c98164625b9cd1ba9f8af4e36f197.zip
Add the ability to pass extra args to a Python breakpoint callback.
For example, it is pretty easy to write a breakpoint command that implements "stop when my caller is Foo", and it is pretty easy to write a breakpoint command that implements "stop when my caller is Bar". But there's no way to write a generic "stop when my caller is..." function, and then specify the caller when you add the command to a breakpoint. With this patch, you can pass this data in a SBStructuredData dictionary. That will get stored in the PythonCommandBaton for the breakpoint, and passed to the implementation function (if it has the right signature) when the breakpoint is hit. Then in lldb, you can say: (lldb) break com add -F caller_is -k caller_name -v Foo More generally this will allow us to write reusable Python breakpoint commands. Differential Revision: https://reviews.llvm.org/D68671
Diffstat (limited to 'lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp')
-rw-r--r--lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
index 9c0b90b28eb..66b5ff84b04 100644
--- a/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
+++ b/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
@@ -62,7 +62,8 @@ extern "C" void init_lldb(void) {}
extern "C" bool LLDBSwigPythonBreakpointCallbackFunction(
const char *python_function_name, const char *session_dictionary_name,
const lldb::StackFrameSP &sb_frame,
- const lldb::BreakpointLocationSP &sb_bp_loc) {
+ const lldb::BreakpointLocationSP &sb_bp_loc,
+ StructuredDataImpl *args_impl) {
return false;
}
OpenPOWER on IntegriCloud