forked from qt-creator/qt-creator
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:
@@ -275,6 +275,26 @@ void LldbEngine::setupInferior()
|
||||
{
|
||||
const DebuggerStartParameters &sp = startParameters();
|
||||
|
||||
const QString path = debuggerCore()->stringSetting(ExtraDumperFile);
|
||||
if (!path.isEmpty()) {
|
||||
QFileInfo fi(path);
|
||||
|
||||
Command cmd1("executeDebuggerCommand");
|
||||
cmd1.arg("command", "python sys.path.insert(1, '" + fi.absolutePath().toUtf8() + "')");
|
||||
runCommand(cmd1);
|
||||
|
||||
Command cmd2("executeDebuggerCommand");
|
||||
cmd2.arg("python from " + fi.baseName().toUtf8() + " import *");
|
||||
runCommand(cmd2);
|
||||
}
|
||||
|
||||
const QString commands = debuggerCore()->stringSetting(ExtraDumperCommands);
|
||||
if (!commands.isEmpty()) {
|
||||
Command cmd("executeDebuggerCommand");
|
||||
cmd.arg(commands.toUtf8());
|
||||
runCommand(cmd);
|
||||
}
|
||||
|
||||
QString executable;
|
||||
Utils::QtcProcess::Arguments args;
|
||||
Utils::QtcProcess::prepareCommand(QFileInfo(sp.executable).absoluteFilePath(),
|
||||
|
||||
Reference in New Issue
Block a user