forked from qt-creator/qt-creator
Debugger: Transform DebuggerRunParameters::commandsAfterConnect
Task-number: QTCREATORBUG-29168 Change-Id: Ifdf756b62940d083ea123d3ef8b08c7c7702fb10 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -146,7 +146,7 @@ bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessa
|
||||
rp.setInferior(inferior);
|
||||
rp.setSymbolFile(bin);
|
||||
rp.setStartMode(AttachToRemoteServer);
|
||||
runTool->setCommandsAfterConnect(initCommands()); // .. and here?
|
||||
rp.setCommandsAfterConnect(initCommands()); // .. and here?
|
||||
rp.setCommandsForReset(resetCommands());
|
||||
rp.setRemoteChannel(channelString());
|
||||
rp.setUseContinueInsteadOfRun(true);
|
||||
|
@@ -437,8 +437,8 @@ void CdbEngine::handleInitialSessionIdle()
|
||||
{
|
||||
m_initialSessionIdleHandled = true;
|
||||
const DebuggerRunParameters &rp = runParameters();
|
||||
if (!rp.commandsAfterConnect.isEmpty())
|
||||
runCommand({rp.commandsAfterConnect, NoFlags});
|
||||
if (!rp.commandsAfterConnect().isEmpty())
|
||||
runCommand({rp.commandsAfterConnect(), NoFlags});
|
||||
//operateByInstructionTriggered(operatesByInstruction());
|
||||
// QmlCppEngine expects the QML engine to be connected before any breakpoints are hit
|
||||
// (attemptBreakpointSynchronization() will be directly called then)
|
||||
|
@@ -417,7 +417,7 @@ void StartApplicationDialog::run(bool attachRemote)
|
||||
debugger->setBreakOnMain(newParameters.breakAtMain);
|
||||
debugger->setDebugInfoLocation(newParameters.debugInfoLocation);
|
||||
rp.setInferior(newParameters.runnable);
|
||||
debugger->setCommandsAfterConnect(newParameters.serverInitCommands);
|
||||
rp.setCommandsAfterConnect(newParameters.serverInitCommands);
|
||||
rp.setCommandsForReset(newParameters.serverResetCommands);
|
||||
debugger->setUseTerminal(newParameters.runInTerminal);
|
||||
rp.setUseExtendedRemote(newParameters.useTargetExtendedRemote);
|
||||
|
@@ -135,7 +135,8 @@ public:
|
||||
void setUseContinueInsteadOfRun(bool on) { m_useContinueInsteadOfRun = on; }
|
||||
bool useContinueInsteadOfRun() const { return m_useContinueInsteadOfRun; }
|
||||
|
||||
QString commandsAfterConnect; // additional commands to post after connection to debug target
|
||||
void setCommandsAfterConnect(const QString &commands) { m_commandsAfterConnect = commands; }
|
||||
QString commandsAfterConnect() const { return m_commandsAfterConnect; }
|
||||
|
||||
// Used by Valgrind
|
||||
QStringList expectedSignals;
|
||||
@@ -242,6 +243,7 @@ private:
|
||||
|
||||
QString m_commandsForReset; // Used by baremetal plugin. Commands used for resetting the inferior
|
||||
bool m_useContinueInsteadOfRun = false; // If connected to a hw debugger run is not possible but continue is used
|
||||
QString m_commandsAfterConnect; // Additional commands to post after connection to debug target
|
||||
};
|
||||
|
||||
namespace Internal {
|
||||
|
@@ -143,11 +143,6 @@ void DebuggerRunTool::setUseTerminal(bool on)
|
||||
m_runParameters.useTerminal = on;
|
||||
}
|
||||
|
||||
void DebuggerRunTool::setCommandsAfterConnect(const QString &commands)
|
||||
{
|
||||
m_runParameters.commandsAfterConnect = commands;
|
||||
}
|
||||
|
||||
void DebuggerRunTool::setDebugInfoLocation(const FilePath &debugInfoLocation)
|
||||
{
|
||||
m_runParameters.debugInfoLocation = debugInfoLocation;
|
||||
|
@@ -42,8 +42,6 @@ public:
|
||||
void setUseTerminal(bool on);
|
||||
void setUseDebugServer(Utils::ProcessHandle attachPid, bool essential, bool useMulti);
|
||||
|
||||
void setCommandsAfterConnect(const QString &commands);
|
||||
|
||||
void setDebugInfoLocation(const Utils::FilePath &debugInfoLocation);
|
||||
|
||||
void setCoreFilePath(const Utils::FilePath &core, bool isSnapshot = false);
|
||||
|
@@ -4436,8 +4436,8 @@ void GdbEngine::claimInitialBreakpoints()
|
||||
// and even if it fails (e.g. due to stripped binaries), continuing with
|
||||
// the start up is the best we can do.
|
||||
|
||||
if (!rp.commandsAfterConnect.isEmpty()) {
|
||||
const QString commands = expand(rp.commandsAfterConnect);
|
||||
if (!rp.commandsAfterConnect().isEmpty()) {
|
||||
const QString commands = expand(rp.commandsAfterConnect());
|
||||
for (const QString &command : commands.split('\n'))
|
||||
runCommand({command, NativeCommand});
|
||||
}
|
||||
|
Reference in New Issue
Block a user