forked from qt-creator/qt-creator
Debugger: Provide a startup customization hook for 3rd party plugins
Change-Id: Ia587abcb1bdcdfbf192d3314610ec9addf370c9b Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -1380,6 +1380,12 @@ QString DebuggerEngine::expand(const QString &string) const
|
|||||||
return d->m_runParameters.macroExpander->expand(string);
|
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)
|
void DebuggerEngine::updateBreakpointMarker(const Breakpoint &bp)
|
||||||
{
|
{
|
||||||
d->m_disassemblerAgent.updateBreakpointMarker(bp);
|
d->m_disassemblerAgent.updateBreakpointMarker(bp);
|
||||||
|
|||||||
@@ -329,6 +329,7 @@ public:
|
|||||||
void removeBreakpointMarker(const Breakpoint &bp);
|
void removeBreakpointMarker(const Breakpoint &bp);
|
||||||
|
|
||||||
QString expand(const QString &string) const;
|
QString expand(const QString &string) const;
|
||||||
|
QString nativeStartupCommands() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void stateChanged(Debugger::DebuggerState state);
|
void stateChanged(Debugger::DebuggerState state);
|
||||||
|
|||||||
@@ -114,6 +114,9 @@ public:
|
|||||||
|
|
||||||
// Used by general core file debugging. Public access requested in QTCREATORBUG-17158.
|
// Used by general core file debugging. Public access requested in QTCREATORBUG-17158.
|
||||||
QString coreFile;
|
QString coreFile;
|
||||||
|
|
||||||
|
// Macro-expanded and passed to debugger startup.
|
||||||
|
QString additionalStartupCommands;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|||||||
@@ -4079,7 +4079,7 @@ void GdbEngine::loadInitScript()
|
|||||||
).arg(script));
|
).arg(script));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const QString commands = expand(stringSetting(GdbStartupCommands));
|
const QString commands = nativeStartupCommands();
|
||||||
if (!commands.isEmpty())
|
if (!commands.isEmpty())
|
||||||
runCommand({commands});
|
runCommand({commands});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ void LldbEngine::startLldbStage2()
|
|||||||
m_lldbProc.write("script print(dir())\n");
|
m_lldbProc.write("script print(dir())\n");
|
||||||
m_lldbProc.write("script theDumper = Dumper()\n"); // This triggers reportState("enginesetupok")
|
m_lldbProc.write("script theDumper = Dumper()\n"); // This triggers reportState("enginesetupok")
|
||||||
|
|
||||||
const QString commands = expand(stringSetting(GdbStartupCommands));
|
const QString commands = nativeStartupCommands();
|
||||||
if (!commands.isEmpty())
|
if (!commands.isEmpty())
|
||||||
m_lldbProc.write(commands.toLocal8Bit() + '\n');
|
m_lldbProc.write(commands.toLocal8Bit() + '\n');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user