From c8fcaab6ce13232258f10c4a1a76dfed0b03fde7 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Wed, 15 May 2013 02:46:08 +0000 Subject: Python breakpoint actions can return False to say that they don't want to stop at the breakpoint to which they are associated Almost all of the work to support this notion of a breakpoint callback was in place, but two small moving parts were missing: a) the SWIG wrapper was not checking the return value of the script b) when passing a Python function by name, the call statement was dropping the return value of the function This checkin addresses both concerns and makes this work Care has been taken that you only keep running when an actual value of False has been returned, and that any other value (None included) means Stop! llvm-svn: 181866 --- lldb/scripts/Python/python-wrapper.swig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lldb/scripts/Python') diff --git a/lldb/scripts/Python/python-wrapper.swig b/lldb/scripts/Python/python-wrapper.swig index 9834f0f2b63..789cf6fae11 100644 --- a/lldb/scripts/Python/python-wrapper.swig +++ b/lldb/scripts/Python/python-wrapper.swig @@ -151,6 +151,10 @@ LLDBSwigPythonBreakpointCallbackFunction if (pvalue != NULL) { + // be very conservative here and only refuse to stop if the user + // actually returned False - anything else, just stop + if (pvalue == Py_False) + stop_at_breakpoint = false; Py_DECREF (pvalue); } else if (PyErr_Occurred ()) -- cgit v1.2.3