Debugger: Switch meaning of inferior.executable and a symbol file

This essentially uses inferior.executable as the actually executed
binary (formerly remoteExecutable) and a new symbolFile as
source of debug info (formerly inferior.executable).

Change-Id: Ib129fa1dd4af2446129ab42eb5ba42154e92ab20
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
hjk
2016-04-21 12:44:11 +02:00
parent ca4076c839
commit b3c1da03e8
4 changed files with 20 additions and 19 deletions

View File

@@ -164,10 +164,10 @@ void GdbRemoteServerEngine::setupInferior()
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
setLinuxOsAbi();
const DebuggerRunParameters &rp = runParameters();
QString executableFileName;
if (!rp.inferior.executable.isEmpty()) {
QFileInfo fi(rp.inferior.executable);
executableFileName = fi.absoluteFilePath();
QString symbolFile;
if (!rp.symbolFile.isEmpty()) {
QFileInfo fi(rp.symbolFile);
symbolFile = fi.absoluteFilePath();
}
//const QByteArray sysroot = sp.sysroot.toLocal8Bit();
@@ -208,14 +208,14 @@ void GdbRemoteServerEngine::setupInferior()
if (boolSetting(TargetAsync))
runCommand({"set target-async on", NoFlags, CB(handleSetTargetAsync)});
if (executableFileName.isEmpty()) {
if (symbolFile.isEmpty()) {
showMessage(tr("No symbol file given."), StatusBar);
callTargetRemote();
return;
}
if (!executableFileName.isEmpty()) {
runCommand({"-file-exec-and-symbols \"" + executableFileName.toLocal8Bit() + '"',
if (!symbolFile.isEmpty()) {
runCommand({"-file-exec-and-symbols \"" + symbolFile.toLocal8Bit() + '"',
NoFlags, CB(handleFileExecAndSymbols)});
}
}
@@ -310,7 +310,7 @@ void GdbRemoteServerEngine::handleTargetExtendedRemote(const DebuggerResponse &r
runCommand({"attach " + QByteArray::number(runParameters().attachPID),
NoFlags, CB(handleTargetExtendedAttach)});
} else {
runCommand({"-gdb-set remote exec-file " + runParameters().remoteExecutable.toLatin1(),
runCommand({"-gdb-set remote exec-file " + runParameters().inferior.executable.toLatin1(),
NoFlags, CB(handleTargetExtendedAttach)});
}
} else {
@@ -342,8 +342,9 @@ void GdbRemoteServerEngine::handleTargetQnx(const DebuggerResponse &response)
showMessage(_("INFERIOR STARTED"));
showMessage(msgAttachedToStoppedInferior(), StatusBar);
const qint64 pid = isMasterEngine() ? runParameters().attachPID : masterEngine()->runParameters().attachPID;
const QString remoteExecutable = isMasterEngine() ? runParameters().remoteExecutable : masterEngine()->runParameters().remoteExecutable;
const DebuggerRunParameters &rp = isMasterEngine() ? runParameters() : masterEngine()->runParameters();
const qint64 pid = rp.attachPID;
const QString remoteExecutable = rp.inferior.executable;
if (pid > -1)
runCommand({"attach " + QByteArray::number(pid), NoFlags, CB(handleAttach)});
else if (!remoteExecutable.isEmpty())
@@ -403,7 +404,7 @@ void GdbRemoteServerEngine::runEngine()
{
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
const QString remoteExecutable = runParameters().remoteExecutable;
const QString remoteExecutable = runParameters().inferior.executable;
if (!remoteExecutable.isEmpty()) {
runCommand({"-exec-run", RunRequest, CB(handleExecRun)});
} else {