<rdar://problem/13883385>

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
This commit is contained in:
Enrico Granata
2013-05-15 02:46:08 +00:00
parent d10f1c04aa
commit c8fcaab6ce
2 changed files with 6 additions and 1 deletions

View File

@@ -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 ())