diff options
-rw-r--r-- | share/qtcreator/debugger/dumper.py | 3 | ||||
-rw-r--r-- | share/qtcreator/debugger/gdbbridge.py | 34 | ||||
-rw-r--r-- | share/qtcreator/debugger/lldbbridge.py | 4 | ||||
-rw-r--r-- | src/plugins/debugger/gdb/gdbengine.cpp | 17 | ||||
-rw-r--r-- | src/plugins/debugger/lldb/lldbengine.cpp | 2 |
5 files changed, 19 insertions, 41 deletions
diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 6dc8f01adc..d363d88b1b 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -1707,7 +1707,8 @@ class DumperBase: findDumperFunctions() - def addDumperModule(self, path): + def addDumperModule(self, args): + path = args['path'] (head, tail) = os.path.split(path) sys.path.insert(1, head) self.dumpermodules.append(os.path.splitext(tail)[0]) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 63cee8255e..6df555bee2 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -1696,6 +1696,10 @@ class Dumper(DumperBase): self.qmlBreakpoints.append(Resolver(self, args)) + def exitGdb(self, _): + if hasPlot: + matplotQuit() + gdb.execute("quit") class CliDumper(Dumper): @@ -1862,17 +1866,6 @@ registerCommand("threadnames", threadnames) ####################################################################### # -# Reload Command -# -####################################################################### - -def reloadDumper(_): - theDumper.reloadDumper(); - -registerCommand("reload", reloadDumper) - -####################################################################### -# # StackFrames Command # ####################################################################### @@ -1893,25 +1886,6 @@ registerCommand("stackListFrames", stackListFrames) ####################################################################### # -# AddExtraDumpers Command -# -####################################################################### - -def addExtraDumper(args): - theDumper.addDumperModule(args) - -registerCommand("addExtraDumper", addExtraDumper) - -def exitGdb(arg): - if hasPlot: - matplotQuit() - gdb.execute("quit") - return "" - -registerCommand("exitGdb", exitGdb) - -####################################################################### -# # Native Mixed # ####################################################################### diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 0ad3ce43ab..80c34a50c7 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -1633,10 +1633,6 @@ class Dumper(DumperBase): error = str(result.GetError()) self.report('success="%d",output="%s",error="%s"' % (success, output, error)) - def addExtraDumper(self, args): - self.addDumperModule(args['path']) - self.report('ok') - def updateData(self, args): if 'expanded' in args: self.expandedINames = set(args['expanded'].split(',')) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 8fefd3d9c6..8a81b49c72 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1884,11 +1884,15 @@ void GdbEngine::notifyAdapterShutdownOk() .arg(lastGoodState()).arg(m_gdbProc->state())); m_commandsDoneCallback = 0; switch (m_gdbProc->state()) { - case QProcess::Running: + case QProcess::Running: { if (startParameters().closeMode == KillAndExitMonitorAtClose) postCommand("monitor exit"); - postCommand("exitGdb", GdbEngine::ExitRequest, CB(handleGdbExit)); + DebuggerCommand cmd("exitGdb"); + cmd.flags = GdbEngine::ExitRequest; + cmd.callback = CB(handleGdbExit); + runCommand(cmd); break; + } case QProcess::NotRunning: // Cannot find executable. notifyEngineShutdownOk(); @@ -4287,8 +4291,11 @@ void GdbEngine::startGdb(const QStringList &args) postCommand("python from gdbbridge import *", flags); const QString path = stringSetting(ExtraDumperFile); - if (!path.isEmpty()) - postCommand("python addExtraDumper('" + path.toUtf8() + "')", flags); + if (!path.isEmpty()) { + DebuggerCommand cmd("addDumperModule"); + cmd.arg("path", path.toUtf8()); + runCommand(cmd); + } const QString commands = stringSetting(ExtraDumperCommands); if (!commands.isEmpty()) @@ -4324,7 +4331,7 @@ void GdbEngine::loadInitScript() void GdbEngine::reloadDebuggingHelpers() { - postCommand("reload"); + runCommand("reloadDumper"); reloadLocals(); } diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 545928b500..903b0bea20 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -285,7 +285,7 @@ void LldbEngine::setupInferior() const QString path = stringSetting(ExtraDumperFile); if (!path.isEmpty()) { - DebuggerCommand cmd("addExtraDumper"); + DebuggerCommand cmd("addDumperModule"); cmd.arg("path", path.toUtf8()); runCommand(cmd); } |