MCPcopy Create free account
hub / github.com/baldurk/renderdoc / traceEvent

Method traceEvent

qrenderdoc/Code/pyrenderdoc/PythonContext.cpp:1366–1393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1364}
1365
1366int 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
1395extern "C" PyThreadState *GetExecutingThreadState(PyObject *global_handle)
1396{

Callers

nothing calls this directly

Calls 2

PyFrame_GetCodeFunction · 0.85
shouldAbortMethod · 0.80

Tested by

no test coverage detected