forked from qt-creator/qt-creator
Debugger: Transform a few fields of DebuggerRunParameters
Transform overrideStartScript and startMessage. Task-number: QTCREATORBUG-29168 Change-Id: Ib29a200aac0007aec0683066f841b8f5692471d6 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -196,8 +196,12 @@ public:
|
||||
|
||||
Utils::ProcessRunData debugger() const { return m_debugger; };
|
||||
|
||||
Utils::FilePath overrideStartScript; // Used in attach to core and remote debugging
|
||||
QString startMessage; // First status message shown.
|
||||
void setOverrideStartScript(const Utils::FilePath &script) { m_overrideStartScript = script; }
|
||||
Utils::FilePath overrideStartScript() const { return m_overrideStartScript; }
|
||||
|
||||
void setStartMessage(const QString &msg) { m_startMessage = msg; }
|
||||
// FIXME: Add a startMessage() getter and use it.
|
||||
|
||||
Utils::FilePath debugInfoLocation; // Gdb "set-debug-file-directory".
|
||||
QStringList debugSourceLocation; // Gdb "directory"
|
||||
Utils::FilePath qtSourceLocation;
|
||||
@@ -301,6 +305,9 @@ private:
|
||||
bool m_runAsRoot = false;
|
||||
|
||||
Utils::ProcessRunData m_debugger;
|
||||
Utils::FilePath m_overrideStartScript; // Used in attach to core and remote debugging
|
||||
|
||||
QString m_startMessage; // First status message shown.
|
||||
};
|
||||
|
||||
namespace Internal {
|
||||
|
@@ -1402,22 +1402,22 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
|
||||
rp.setCloseMode(DetachAtClose);
|
||||
rp.setAttachPid(pid);
|
||||
rp.setDisplayName(Tr::tr("Process %1").arg(pid));
|
||||
debugger->setStartMessage(Tr::tr("Attaching to local process %1.").arg(pid));
|
||||
rp.setStartMessage(Tr::tr("Attaching to local process %1.").arg(pid));
|
||||
} else if (startMode == AttachToRemoteServer) {
|
||||
rp.setStartMode(AttachToRemoteServer);
|
||||
rp.setRemoteChannel(remoteChannel);
|
||||
rp.setDisplayName(Tr::tr("Remote: \"%1\"").arg(remoteChannel));
|
||||
debugger->setStartMessage(Tr::tr("Attaching to remote server %1.").arg(remoteChannel));
|
||||
rp.setStartMessage(Tr::tr("Attaching to remote server %1.").arg(remoteChannel));
|
||||
} else if (startMode == AttachToCore) {
|
||||
rp.setStartMode(AttachToCore);
|
||||
rp.setCloseMode(DetachAtClose);
|
||||
rp.setCoreFilePath(coreFile);
|
||||
rp.setDisplayName(Tr::tr("Core file \"%1\"").arg(coreFile.toUserOutput()));
|
||||
debugger->setStartMessage(Tr::tr("Attaching to core file %1.").arg(coreFile.toUserOutput()));
|
||||
rp.setStartMessage(Tr::tr("Attaching to core file %1.").arg(coreFile.toUserOutput()));
|
||||
} else {
|
||||
rp.setStartMode(StartExternal);
|
||||
rp.setDisplayName(Tr::tr("Executable file \"%1\"").arg(executable.toUserOutput()));
|
||||
debugger->setStartMessage(Tr::tr("Debugging file %1.").arg(executable.toUserOutput()));
|
||||
rp.setStartMessage(Tr::tr("Debugging file %1.").arg(executable.toUserOutput()));
|
||||
}
|
||||
rp.setUseTerminal(useTerminal);
|
||||
|
||||
@@ -1444,7 +1444,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
|
||||
debugger->setCrashParameter(it->section(':', 0, 0));
|
||||
rp.setAttachPid(pid);
|
||||
rp.setDisplayName(Tr::tr("Crashed process %1").arg(pid));
|
||||
debugger->setStartMessage(Tr::tr("Attaching to crashed process %1").arg(pid));
|
||||
rp.setStartMessage(Tr::tr("Attaching to crashed process %1").arg(pid));
|
||||
if (pid < 1) {
|
||||
*errorMessage = Tr::tr("The parameter \"%1\" of option \"%2\" "
|
||||
"does not match the pattern <handle>:<pid>.").arg(*it, option);
|
||||
|
@@ -113,21 +113,11 @@ void DebuggerRunTool::setTestCase(int testCase)
|
||||
m_runParameters.testCase = testCase;
|
||||
}
|
||||
|
||||
void DebuggerRunTool::setOverrideStartScript(const FilePath &script)
|
||||
{
|
||||
m_runParameters.overrideStartScript = script;
|
||||
}
|
||||
|
||||
void DebuggerRunTool::setAbi(const Abi &abi)
|
||||
{
|
||||
m_runParameters.toolChainAbi = abi;
|
||||
}
|
||||
|
||||
void DebuggerRunTool::setStartMessage(const QString &msg)
|
||||
{
|
||||
m_runParameters.startMessage = msg;
|
||||
}
|
||||
|
||||
void DebuggerRunTool::addQmlServerInferiorCommandLineArgumentIfNeeded()
|
||||
{
|
||||
d->addQmlServerInferiorCommandLineArgumentIfNeeded = true;
|
||||
|
@@ -30,7 +30,6 @@ public:
|
||||
void start() override;
|
||||
void stop() override;
|
||||
|
||||
void setStartMessage(const QString &msg);
|
||||
void setCrashParameter(const QString &event);
|
||||
|
||||
void setUseDebugServer(Utils::ProcessHandle attachPid, bool essential, bool useMulti);
|
||||
@@ -38,7 +37,6 @@ public:
|
||||
void setDebugInfoLocation(const Utils::FilePath &debugInfoLocation);
|
||||
|
||||
void setTestCase(int testCase);
|
||||
void setOverrideStartScript(const Utils::FilePath &script);
|
||||
|
||||
void kickoffTerminalProcess();
|
||||
void interruptTerminal();
|
||||
|
@@ -4077,7 +4077,7 @@ void GdbEngine::handleGdbStartFailed()
|
||||
|
||||
void GdbEngine::loadInitScript()
|
||||
{
|
||||
const FilePath script = runParameters().overrideStartScript;
|
||||
const FilePath script = runParameters().overrideStartScript();
|
||||
if (!script.isEmpty()) {
|
||||
if (script.isReadableFile()) {
|
||||
runCommand({"source " + script.path()});
|
||||
|
@@ -355,7 +355,7 @@ void runAttachToCoreDialog()
|
||||
rp.setCoreFilePath(dlg.coreFileCopy());
|
||||
rp.setStartMode(AttachToCore);
|
||||
rp.setCloseMode(DetachAtClose);
|
||||
debugger->setOverrideStartScript(dlg.overrideStartScript());
|
||||
rp.setOverrideStartScript(dlg.overrideStartScript());
|
||||
const FilePath sysRoot = dlg.sysRoot();
|
||||
if (!sysRoot.isEmpty())
|
||||
rp.setSysRoot(sysRoot);
|
||||
|
Reference in New Issue
Block a user