diff options
author | hjk <hjk@theqtcompany.com> | 2015-02-11 12:20:21 +0100 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2015-02-11 15:00:35 +0000 |
commit | e76c4839bbba3dcd21a84fdd1ff3a513943fd695 (patch) | |
tree | d6ddb62b4e8d8f937cda0c41c32aa939e2e8f8f7 /src | |
parent | 2c4b9fb64fbd158994031d767ab8318bcebe7fc2 (diff) | |
download | qt-creator-e76c4839bbba3dcd21a84fdd1ff3a513943fd695.tar.gz |
Debugger: Consolidate some GDB-through-Python interaction
Instead of calling a GDB extension command invoking a function
on the well-known Dumper instance, call the Dumper function
directly. This also makes the code more similar to the LLDB side.
Change-Id: I4b23177eb72a904721b63c578ce7fbfe204f02a2
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/debugger/gdb/gdbengine.cpp | 17 | ||||
-rw-r--r-- | src/plugins/debugger/lldb/lldbengine.cpp | 2 |
2 files changed, 13 insertions, 6 deletions
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); } |