Load debugpy when possible to allow python debugging in-program

This commit is contained in:
baldurk
2026-08-13 17:46:39 +01:00
parent 53e5e718b1
commit d71827d6a1
11 changed files with 523 additions and 6 deletions
@@ -67,6 +67,8 @@ public:
static void GenerateStubs(const rdcarray<rdcstr> &extraPaths);
static void PrepareDebugTracing();
bool CheckInterfaces(rdcstr &log);
QString versionString();
@@ -104,6 +106,8 @@ public:
bool shouldAbort() { return m_Abort; }
QString currentFile() { return location.file; }
int currentLine() { return location.line; }
static void AddDebuggableThread();
static void RemoveDebuggableThread();
signals:
void traceLine(const QString &file, int line);
void exception(const QString &type, const QString &value, int finalLine, QList<QString> frames);
@@ -121,6 +125,13 @@ private:
// python context
static PyObject *main_dict;
// this is the debugpy module
static PyObject *m_DebugPy;
// these are used for callbacks where we have no python frame (e.g. C code on the UI calling into
// a registered python callback) so need to quickly set up things for debugging if enabled
static PyObject *m_CallWrapper;
static PyObject *m_CallWrapperGlobals;
// the list of extension objects, to be able to reload them
static QMap<rdcstr, PyObject *> extensions;