| 1364 | } |
| 1365 | |
| 1366 | int PythonContext::traceEvent(PyObject *obj, PyFrameObject *frame, int what, PyObject *arg) |
| 1367 | { |
| 1368 | PyObject *thisobj = PyDict_GetItemString(obj, "thisobj"); |
| 1369 | |
| 1370 | uint64_t thisuint64 = PyLong_AsUnsignedLongLong(thisobj); |
| 1371 | uintptr_t thisint = (uintptr_t)thisuint64; |
| 1372 | PythonContext *context = (PythonContext *)thisint; |
| 1373 | |
| 1374 | PyCodeObject *code = PyFrame_GetCode(frame); |
| 1375 | |
| 1376 | PyObject *compiled = PyDict_GetItemString(obj, "compiled"); |
| 1377 | if(compiled == (PyObject *)code && what == PyTrace_LINE) |
| 1378 | { |
| 1379 | context->location.line = PyFrame_GetLineNumber(frame); |
| 1380 | |
| 1381 | emit context->traceLine(context->location.file, context->location.line); |
| 1382 | } |
| 1383 | |
| 1384 | Py_XDECREF(code); |
| 1385 | |
| 1386 | if(context->shouldAbort()) |
| 1387 | { |
| 1388 | PyErr_SetString(PyExc_SystemExit, "Execution aborted."); |
| 1389 | return -1; |
| 1390 | } |
| 1391 | |
| 1392 | return 0; |
| 1393 | } |
| 1394 | |
| 1395 | extern "C" PyThreadState *GetExecutingThreadState(PyObject *global_handle) |
| 1396 | { |
nothing calls this directly
no test coverage detected