Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | /* |
| 2 | lldb.swig |
| 3 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 4 | This is the input file for SWIG, to create the appropriate C++ wrappers and |
| 5 | functions for various scripting languages, to enable them to call the |
| 6 | liblldb Script Bridge functions. |
| 7 | |
| 8 | */ |
| 9 | |
| 10 | /* The name of the module to be created. */ |
| 11 | |
| 12 | %module lldb |
| 13 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 14 | /* Typemap definitions, to allow SWIG to properly handle 'char**' data types. */ |
| 15 | |
| 16 | %typemap(in) char ** { |
| 17 | /* Check if is a list */ |
| 18 | if (PyList_Check($input)) { |
| 19 | int size = PyList_Size($input); |
| 20 | int i = 0; |
Greg Clayton | 0d62dfd | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 21 | $1 = (char **) malloc((size+1) * sizeof(char*)); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 22 | for (i = 0; i < size; i++) { |
| 23 | PyObject *o = PyList_GetItem($input,i); |
| 24 | if (PyString_Check(o)) |
Greg Clayton | 0d62dfd | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 25 | $1[i] = PyString_AsString(o); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 26 | else { |
| 27 | PyErr_SetString(PyExc_TypeError,"list must contain strings"); |
| 28 | free($1); |
| 29 | return NULL; |
| 30 | } |
| 31 | } |
| 32 | $1[i] = 0; |
Caroline Tice | 558be58 | 2010-06-30 16:22:25 +0000 | [diff] [blame] | 33 | } else if ($input == Py_None) { |
| 34 | $1 = NULL; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 35 | } else { |
| 36 | PyErr_SetString(PyExc_TypeError,"not a list"); |
| 37 | return NULL; |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | %typemap(freearg) char** { |
| 42 | free((char *) $1); |
| 43 | } |
| 44 | |
| 45 | %typemap(out) char** { |
| 46 | int len; |
| 47 | int i; |
| 48 | len = 0; |
| 49 | while ($1[len]) len++; |
| 50 | $result = PyList_New(len); |
| 51 | for (i = 0; i < len; i++) { |
| 52 | PyList_SetItem($result, i, PyString_FromString($1[i])); |
| 53 | } |
| 54 | } |
| 55 | |
Johnny Chen | 586a3e6 | 2011-03-07 21:28:57 +0000 | [diff] [blame] | 56 | /* Typemap definitions to allow SWIG to properly handle char buffer. */ |
| 57 | |
| 58 | // typemap for a char buffer |
| 59 | // See also SBThread::GetStopDescription. |
| 60 | %typemap(in) (char *dst, size_t dst_len) { |
| 61 | if (!PyInt_Check($input)) { |
| 62 | PyErr_SetString(PyExc_ValueError, "Expecting an integer"); |
| 63 | return NULL; |
| 64 | } |
| 65 | $2 = PyInt_AsLong($input); |
Johnny Chen | 562ed0e | 2011-03-23 00:26:08 +0000 | [diff] [blame] | 66 | if ($2 <= 0) { |
Johnny Chen | 586a3e6 | 2011-03-07 21:28:57 +0000 | [diff] [blame] | 67 | PyErr_SetString(PyExc_ValueError, "Positive integer expected"); |
| 68 | return NULL; |
| 69 | } |
| 70 | $1 = (char *) malloc($2); |
| 71 | } |
| 72 | |
| 73 | // Return the char buffer. Discarding any previous return result |
| 74 | // See also SBThread::GetStopDescription. |
| 75 | %typemap(argout) (char *dst, size_t dst_len) { |
| 76 | Py_XDECREF($result); /* Blow away any previous result */ |
| 77 | $result = PyString_FromStringAndSize(($1),result); |
| 78 | free($1); |
| 79 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 80 | |
Greg Clayton | 0d62dfd | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 81 | |
| 82 | // typemap for an outgoing buffer |
Johnny Chen | 586a3e6 | 2011-03-07 21:28:57 +0000 | [diff] [blame] | 83 | // See also SBProcess::WriteMemory. |
Johnny Chen | 36a0f74 | 2011-03-01 02:20:14 +0000 | [diff] [blame] | 84 | %typemap(in) (const void *buf, size_t size) { |
Greg Clayton | 0d62dfd | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 85 | if (!PyString_Check($input)) { |
| 86 | PyErr_SetString(PyExc_ValueError, "Expecting a string"); |
| 87 | return NULL; |
| 88 | } |
| 89 | $1 = (void *) PyString_AsString($input); |
| 90 | $2 = PyString_Size($input); |
| 91 | } |
| 92 | |
| 93 | // typemap for an incoming buffer |
Johnny Chen | 586a3e6 | 2011-03-07 21:28:57 +0000 | [diff] [blame] | 94 | // See also SBProcess::ReadMemory. |
Johnny Chen | 36a0f74 | 2011-03-01 02:20:14 +0000 | [diff] [blame] | 95 | %typemap(in) (void *buf, size_t size) { |
Greg Clayton | 0d62dfd | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 96 | if (!PyInt_Check($input)) { |
| 97 | PyErr_SetString(PyExc_ValueError, "Expecting an integer"); |
| 98 | return NULL; |
| 99 | } |
| 100 | $2 = PyInt_AsLong($input); |
Johnny Chen | 562ed0e | 2011-03-23 00:26:08 +0000 | [diff] [blame] | 101 | if ($2 <= 0) { |
Greg Clayton | 0d62dfd | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 102 | PyErr_SetString(PyExc_ValueError, "Positive integer expected"); |
| 103 | return NULL; |
| 104 | } |
| 105 | $1 = (void *) malloc($2); |
| 106 | } |
| 107 | |
| 108 | // Return the buffer. Discarding any previous return result |
Johnny Chen | 586a3e6 | 2011-03-07 21:28:57 +0000 | [diff] [blame] | 109 | // See also SBProcess::ReadMemory. |
Johnny Chen | 36a0f74 | 2011-03-01 02:20:14 +0000 | [diff] [blame] | 110 | %typemap(argout) (void *buf, size_t size) { |
Greg Clayton | 0d62dfd | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 111 | Py_XDECREF($result); /* Blow away any previous result */ |
Johnny Chen | 36a0f74 | 2011-03-01 02:20:14 +0000 | [diff] [blame] | 112 | $result = PyString_FromStringAndSize(static_cast<const char*>($1),result); |
Greg Clayton | 0d62dfd | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 113 | free($1); |
| 114 | } |
| 115 | |
Greg Clayton | 461a437 | 2010-06-12 15:34:20 +0000 | [diff] [blame] | 116 | /* The liblldb header files to be included. */ |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 117 | |
| 118 | %{ |
Greg Clayton | b344843 | 2011-03-24 21:19:54 +0000 | [diff] [blame] | 119 | #include "lldb/lldb-public.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 120 | #include "lldb/API/SBAddress.h" |
| 121 | #include "lldb/API/SBBlock.h" |
| 122 | #include "lldb/API/SBBreakpoint.h" |
| 123 | #include "lldb/API/SBBreakpointLocation.h" |
| 124 | #include "lldb/API/SBBroadcaster.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 125 | #include "lldb/API/SBCommandInterpreter.h" |
| 126 | #include "lldb/API/SBCommandReturnObject.h" |
Greg Clayton | d8c6253 | 2010-10-07 04:19:01 +0000 | [diff] [blame] | 127 | #include "lldb/API/SBCommunication.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 128 | #include "lldb/API/SBCompileUnit.h" |
| 129 | #include "lldb/API/SBDebugger.h" |
| 130 | #include "lldb/API/SBError.h" |
| 131 | #include "lldb/API/SBEvent.h" |
Johnny Chen | 4ead2e9 | 2010-08-27 22:35:26 +0000 | [diff] [blame] | 132 | #include "lldb/API/SBFileSpec.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 133 | #include "lldb/API/SBFrame.h" |
| 134 | #include "lldb/API/SBFunction.h" |
Greg Clayton | d8c6253 | 2010-10-07 04:19:01 +0000 | [diff] [blame] | 135 | #include "lldb/API/SBHostOS.h" |
| 136 | #include "lldb/API/SBInputReader.h" |
Greg Clayton | 5c4c746 | 2010-10-06 03:09:58 +0000 | [diff] [blame] | 137 | #include "lldb/API/SBInstruction.h" |
| 138 | #include "lldb/API/SBInstructionList.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 139 | #include "lldb/API/SBLineEntry.h" |
| 140 | #include "lldb/API/SBListener.h" |
| 141 | #include "lldb/API/SBModule.h" |
| 142 | #include "lldb/API/SBProcess.h" |
| 143 | #include "lldb/API/SBSourceManager.h" |
Caroline Tice | 98f930f | 2010-09-20 05:20:02 +0000 | [diff] [blame] | 144 | #include "lldb/API/SBStream.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 145 | #include "lldb/API/SBStringList.h" |
| 146 | #include "lldb/API/SBSymbol.h" |
| 147 | #include "lldb/API/SBSymbolContext.h" |
Greg Clayton | d8c6253 | 2010-10-07 04:19:01 +0000 | [diff] [blame] | 148 | #include "lldb/API/SBSymbolContextList.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 149 | #include "lldb/API/SBTarget.h" |
| 150 | #include "lldb/API/SBThread.h" |
| 151 | #include "lldb/API/SBType.h" |
| 152 | #include "lldb/API/SBValue.h" |
Caroline Tice | 1ca48b0 | 2010-09-22 16:41:52 +0000 | [diff] [blame] | 153 | #include "lldb/API/SBValueList.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 154 | %} |
| 155 | |
| 156 | /* Various liblldb typedefs that SWIG needs to know about. */ |
Johnny Chen | c1955f2 | 2010-12-16 00:01:06 +0000 | [diff] [blame] | 157 | #define __extension__ /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h. */ |
Greg Clayton | d8c6253 | 2010-10-07 04:19:01 +0000 | [diff] [blame] | 158 | %include <stdint.h> |
| 159 | %include "lldb/lldb-defines.h" |
| 160 | %include "lldb/lldb-enumerations.h" |
| 161 | %include "lldb/lldb-forward.h" |
| 162 | %include "lldb/lldb-forward-rtti.h" |
| 163 | %include "lldb/lldb-types.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 164 | %include "lldb/API/SBAddress.h" |
| 165 | %include "lldb/API/SBBlock.h" |
| 166 | %include "lldb/API/SBBreakpoint.h" |
| 167 | %include "lldb/API/SBBreakpointLocation.h" |
| 168 | %include "lldb/API/SBBroadcaster.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 169 | %include "lldb/API/SBCommandInterpreter.h" |
| 170 | %include "lldb/API/SBCommandReturnObject.h" |
Greg Clayton | d8c6253 | 2010-10-07 04:19:01 +0000 | [diff] [blame] | 171 | %include "lldb/API/SBCommunication.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 172 | %include "lldb/API/SBCompileUnit.h" |
| 173 | %include "lldb/API/SBDebugger.h" |
| 174 | %include "lldb/API/SBError.h" |
| 175 | %include "lldb/API/SBEvent.h" |
Johnny Chen | 4ead2e9 | 2010-08-27 22:35:26 +0000 | [diff] [blame] | 176 | %include "lldb/API/SBFileSpec.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 177 | %include "lldb/API/SBFrame.h" |
| 178 | %include "lldb/API/SBFunction.h" |
Greg Clayton | d8c6253 | 2010-10-07 04:19:01 +0000 | [diff] [blame] | 179 | %include "lldb/API/SBHostOS.h" |
| 180 | %include "lldb/API/SBInputReader.h" |
Greg Clayton | 5c4c746 | 2010-10-06 03:09:58 +0000 | [diff] [blame] | 181 | %include "lldb/API/SBInstruction.h" |
| 182 | %include "lldb/API/SBInstructionList.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 183 | %include "lldb/API/SBLineEntry.h" |
| 184 | %include "lldb/API/SBListener.h" |
| 185 | %include "lldb/API/SBModule.h" |
| 186 | %include "lldb/API/SBProcess.h" |
| 187 | %include "lldb/API/SBSourceManager.h" |
Caroline Tice | 98f930f | 2010-09-20 05:20:02 +0000 | [diff] [blame] | 188 | %include "lldb/API/SBStream.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 189 | %include "lldb/API/SBStringList.h" |
| 190 | %include "lldb/API/SBSymbol.h" |
| 191 | %include "lldb/API/SBSymbolContext.h" |
Greg Clayton | d8c6253 | 2010-10-07 04:19:01 +0000 | [diff] [blame] | 192 | %include "lldb/API/SBSymbolContextList.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 193 | %include "lldb/API/SBTarget.h" |
| 194 | %include "lldb/API/SBThread.h" |
| 195 | %include "lldb/API/SBType.h" |
| 196 | %include "lldb/API/SBValue.h" |
Caroline Tice | 1ca48b0 | 2010-09-22 16:41:52 +0000 | [diff] [blame] | 197 | %include "lldb/API/SBValueList.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 198 | |
Caroline Tice | e49ec18 | 2010-09-22 23:01:29 +0000 | [diff] [blame] | 199 | %include "./Python/python-extensions.swig" |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 200 | |
| 201 | |
| 202 | %wrapper %{ |
| 203 | |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 204 | // This function is called by lldb_private::ScriptInterpreterPython::BreakpointCallbackFunction(...) |
| 205 | // and is used when a script command is attached to a breakpoint for execution. |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 206 | |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 207 | SWIGEXPORT bool |
Greg Clayton | e86cbb9 | 2011-03-22 01:14:58 +0000 | [diff] [blame] | 208 | LLDBSwigPythonBreakpointCallbackFunction |
Greg Clayton | d8c6253 | 2010-10-07 04:19:01 +0000 | [diff] [blame] | 209 | ( |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 210 | const char *python_function_name, |
Caroline Tice | 0aa2e55 | 2011-01-14 00:29:16 +0000 | [diff] [blame] | 211 | const char *session_dictionary_name, |
Greg Clayton | e86cbb9 | 2011-03-22 01:14:58 +0000 | [diff] [blame] | 212 | const lldb::StackFrameSP& frame_sp, |
| 213 | const lldb::BreakpointLocationSP& bp_loc_sp |
Greg Clayton | d8c6253 | 2010-10-07 04:19:01 +0000 | [diff] [blame] | 214 | ) |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 215 | { |
Greg Clayton | e86cbb9 | 2011-03-22 01:14:58 +0000 | [diff] [blame] | 216 | lldb::SBFrame sb_frame (frame_sp); |
| 217 | lldb::SBBreakpointLocation sb_bp_loc(bp_loc_sp); |
| 218 | |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 219 | bool stop_at_breakpoint = true; |
| 220 | PyObject *Frame_PyObj = SWIG_NewPointerObj((void *) &sb_frame, SWIGTYPE_p_lldb__SBFrame, 0); |
| 221 | PyObject *Bp_Loc_PyObj = SWIG_NewPointerObj ((void *) &sb_bp_loc, SWIGTYPE_p_lldb__SBBreakpointLocation, 0); |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 222 | |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 223 | if (Frame_PyObj == NULL || Bp_Loc_PyObj == NULL) |
| 224 | return stop_at_breakpoint; |
Caroline Tice | 0aa2e55 | 2011-01-14 00:29:16 +0000 | [diff] [blame] | 225 | |
| 226 | if (!python_function_name || !session_dictionary_name) |
| 227 | return stop_at_breakpoint; |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 228 | |
Caroline Tice | 0aa2e55 | 2011-01-14 00:29:16 +0000 | [diff] [blame] | 229 | PyObject *pmodule, *main_dict, *session_dict, *pfunc; |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 230 | PyObject *pargs, *pvalue; |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 231 | |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 232 | pmodule = PyImport_AddModule ("__main__"); |
| 233 | if (pmodule != NULL) |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 234 | { |
Caroline Tice | 0aa2e55 | 2011-01-14 00:29:16 +0000 | [diff] [blame] | 235 | main_dict = PyModule_GetDict (pmodule); |
| 236 | if (main_dict != NULL) |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 237 | { |
Caroline Tice | 0aa2e55 | 2011-01-14 00:29:16 +0000 | [diff] [blame] | 238 | PyObject *key, *value; |
| 239 | Py_ssize_t pos = 0; |
| 240 | |
| 241 | // Find the current session's dictionary in the main module's dictionary. |
| 242 | |
| 243 | if (PyDict_Check (main_dict)) |
| 244 | |
| 245 | { |
| 246 | session_dict = NULL; |
| 247 | while (PyDict_Next (main_dict, &pos, &key, &value)) |
| 248 | { |
| 249 | // We have stolen references to the key and value objects in the dictionary; we need to increment |
| 250 | // them now so that Python's garbage collector doesn't collect them out from under us. |
| 251 | Py_INCREF (key); |
| 252 | Py_INCREF (value); |
| 253 | if (strcmp (PyString_AsString (key), session_dictionary_name) == 0) |
| 254 | { |
| 255 | session_dict = value; |
| 256 | break; |
| 257 | } |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | if (!session_dict || !PyDict_Check (session_dict)) |
| 262 | return stop_at_breakpoint; |
| 263 | |
| 264 | // Find the function we need to call in the current session's dictionary. |
| 265 | |
| 266 | pos = 0; |
| 267 | pfunc = NULL; |
| 268 | while (PyDict_Next (session_dict, &pos, &key, &value)) |
| 269 | { |
| 270 | if (PyString_Check (key)) |
| 271 | { |
| 272 | // We have stolen references to the key and value objects in the dictionary; we need to increment |
| 273 | // them now so that Python's garbage collector doesn't collect them out from under us. |
| 274 | Py_INCREF (key); |
| 275 | Py_INCREF (value); |
| 276 | if (strcmp (PyString_AsString (key), python_function_name) == 0) |
| 277 | { |
| 278 | pfunc = value; |
| 279 | break; |
| 280 | } |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | // Set up the arguments and call the function. |
| 285 | |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 286 | if (pfunc && PyCallable_Check (pfunc)) |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 287 | { |
Caroline Tice | 0aa2e55 | 2011-01-14 00:29:16 +0000 | [diff] [blame] | 288 | pargs = PyTuple_New (3); |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 289 | if (pargs == NULL) |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 290 | { |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 291 | if (PyErr_Occurred()) |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 292 | PyErr_Clear(); |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 293 | return stop_at_breakpoint; |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 294 | } |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 295 | |
| 296 | PyTuple_SetItem (pargs, 0, Frame_PyObj); // This "steals" a reference to Frame_PyObj |
| 297 | PyTuple_SetItem (pargs, 1, Bp_Loc_PyObj); // This "steals" a reference to Bp_Loc_PyObj |
Caroline Tice | 0aa2e55 | 2011-01-14 00:29:16 +0000 | [diff] [blame] | 298 | PyTuple_SetItem (pargs, 2, session_dict); // This "steals" a reference to session_dict |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 299 | pvalue = PyObject_CallObject (pfunc, pargs); |
| 300 | Py_DECREF (pargs); |
| 301 | |
| 302 | if (pvalue != NULL) |
| 303 | { |
| 304 | Py_DECREF (pvalue); |
| 305 | } |
| 306 | else if (PyErr_Occurred ()) |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 307 | { |
| 308 | PyErr_Clear(); |
| 309 | } |
Caroline Tice | 0aa2e55 | 2011-01-14 00:29:16 +0000 | [diff] [blame] | 310 | Py_INCREF (session_dict); |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 311 | } |
| 312 | else if (PyErr_Occurred()) |
| 313 | { |
| 314 | PyErr_Clear(); |
| 315 | } |
| 316 | } |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 317 | else if (PyErr_Occurred()) |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 318 | { |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 319 | PyErr_Clear(); |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 320 | } |
| 321 | } |
Greg Clayton | 5144f38 | 2010-10-07 17:14:24 +0000 | [diff] [blame] | 322 | else if (PyErr_Occurred ()) |
| 323 | { |
| 324 | PyErr_Clear (); |
| 325 | } |
| 326 | return stop_at_breakpoint; |
Caroline Tice | 59c5d5d | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 327 | } |
| 328 | |
| 329 | %} |