Debugger: Allow loading dumpers from a file directly

Instead of requiring the user to add the required python
code to load them manually let him specify a file directly.
This also makes the feature accessible to LLDB which needs
a slightly different syntax.

Task-number: QTCREATORBUG-12492
Change-Id: I12621b1cea2429476b0865bcbcb739a238dcf6af
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2014-06-23 16:33:19 +02:00
parent a83548f189
commit fc46406fc8
5 changed files with 57 additions and 9 deletions

View File

@@ -1735,12 +1735,25 @@ void GdbEngine::handlePythonSetup(const GdbResponse &response)
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
if (response.resultClass == GdbResultDone) {
const QString commands = debuggerCore()->stringSetting(GdbCustomDumperCommands);
bool needSetup = false;
const QString path = debuggerCore()->stringSetting(ExtraDumperFile);
if (!path.isEmpty()) {
QFileInfo fi(path);
postCommand("python sys.path.insert(1, '" + fi.absolutePath().toUtf8() + "')");
postCommand("python from " + fi.baseName().toUtf8() + " import *");
needSetup = true;
}
const QString commands = debuggerCore()->stringSetting(ExtraDumperCommands);
if (!commands.isEmpty()) {
postCommand(commands.toLocal8Bit());
postCommand("bbsetup");
needSetup = true;
}
if (needSetup)
postCommand("bbsetup");
GdbMi data;
data.fromStringMultiple(response.consoleStreamOutput);
const GdbMi dumpers = data["dumpers"];