Menu

debug python scripts from pythonQt application with pdb

Help
2015-11-03
2015-11-12
  • Joerg Kreuzberger

    According to an earlier thread i started debugging with pdb in the embedded PythonQt

    this works well except the pdb reads from stdin, must find a way to get the input from an widget or other File Handle.

    Question is how to "pdb" an running script.
    I started a script in a context, the script takes a long time to execute.
    I now want to start debugging on the script. I.E. attach debugger to running script.
    So i started a second script, in the same context as the first one and call
    import pdb
    pdb.set_trace()
    to enter debugger.

    Unfortunatly the script immediatly exists with SIGSEV. Is there a way to execute pdb on a running script? Or at least to "pause" a runnict script execution, called by
    PythonQtObjectPtr.evalScript(....)

     
  • Joerg Kreuzberger

    After some work i was able to run it in debugger.
    The signal comes from here (object.c)

    PyObject
    PyObject_RichCompare(PyObject
    v, PyObject w, int op)
    {
    PyObject
    res;

    assert(Py_LT <= op && op <= Py_GE);
    

    --> if (Py_EnterRecursiveCall(" in cmp"))

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.