Commit 66b19f33 authored by hjk's avatar hjk

Debugger: Provide a startup customization hook for 3rd party plugins

Change-Id: Ia587abcb1bdcdfbf192d3314610ec9addf370c9b
Reviewed-by: David Schulz's avatarDavid Schulz <david.schulz@qt.io>
parent 7beb5d5c
......@@ -1380,6 +1380,12 @@ QString DebuggerEngine::expand(const QString &string) const
return d->m_runParameters.macroExpander->expand(string);
}
QString DebuggerEngine::nativeStartupCommands() const
{
return expand(QStringList({stringSetting(GdbStartupCommands),
runParameters().additionalStartupCommands}).join('\n'));
}
void DebuggerEngine::updateBreakpointMarker(const Breakpoint &bp)
{
d->m_disassemblerAgent.updateBreakpointMarker(bp);
......
......@@ -329,6 +329,7 @@ public:
void removeBreakpointMarker(const Breakpoint &bp);
QString expand(const QString &string) const;
QString nativeStartupCommands() const;
signals:
void stateChanged(Debugger::DebuggerState state);
......
......@@ -114,6 +114,9 @@ public:
// Used by general core file debugging. Public access requested in QTCREATORBUG-17158.
QString coreFile;
// Macro-expanded and passed to debugger startup.
QString additionalStartupCommands;
};
} // namespace Debugger
......
......@@ -4079,7 +4079,7 @@ void GdbEngine::loadInitScript()
).arg(script));
}
} else {
const QString commands = expand(stringSetting(GdbStartupCommands));
const QString commands = nativeStartupCommands();
if (!commands.isEmpty())
runCommand({commands});
}
......
......@@ -307,7 +307,7 @@ void LldbEngine::startLldbStage2()
m_lldbProc.write("script print(dir())\n");
m_lldbProc.write("script theDumper = Dumper()\n"); // This triggers reportState("enginesetupok")
const QString commands = expand(stringSetting(GdbStartupCommands));
const QString commands = nativeStartupCommands();
if (!commands.isEmpty())
m_lldbProc.write(commands.toLocal8Bit() + '\n');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment