forked from qt-creator/qt-creator
Debugger: Transform a few fields of DebuggerRunParameters
Transform projectSourceDirectory and projectSourceFiles. Task-number: QTCREATORBUG-29168 Change-Id: I3e5f28f22df5b84f82f10e4daff10df2a62016f1 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -176,11 +176,11 @@ DebuggerRunParameters DebuggerRunParameters::fromRunControl(ProjectExplorer::Run
|
||||
params.m_debugger.command.setExecutable(FilePath::fromString(envBinary));
|
||||
|
||||
if (Project *project = runControl->project()) {
|
||||
params.projectSourceDirectory = project->projectDirectory();
|
||||
params.projectSourceFiles = project->files(Project::SourceFiles);
|
||||
params.m_projectSourceDirectory = project->projectDirectory();
|
||||
params.m_projectSourceFiles = project->files(Project::SourceFiles);
|
||||
} else {
|
||||
params.projectSourceDirectory = params.debugger().command.executable().parentDir();
|
||||
params.projectSourceFiles.clear();
|
||||
params.m_projectSourceDirectory = params.debugger().command.executable().parentDir();
|
||||
params.m_projectSourceFiles.clear();
|
||||
}
|
||||
|
||||
params.m_toolChainAbi = ToolchainKitAspect::targetAbi(kit);
|
||||
@@ -322,9 +322,9 @@ void DebuggerRunParameters::setStartMode(DebuggerStartMode startMode)
|
||||
projects.insert(0, startupProject);
|
||||
}
|
||||
for (Project *project : std::as_const(projects))
|
||||
projectSourceFiles.append(project->files(Project::SourceFiles));
|
||||
m_projectSourceFiles.append(project->files(Project::SourceFiles));
|
||||
if (!projects.isEmpty())
|
||||
projectSourceDirectory = projects.first()->projectDirectory();
|
||||
m_projectSourceDirectory = projects.first()->projectDirectory();
|
||||
}
|
||||
|
||||
void DebuggerRunParameters::addSolibSearchDir(const QString &str)
|
||||
@@ -2911,8 +2911,8 @@ QString DebuggerEngine::formatStartParameters() const
|
||||
str << "Core: " << rp.coreFile().toUserOutput() << '\n';
|
||||
if (rp.attachPid().isValid())
|
||||
str << "PID: " << rp.attachPid().pid() << ' ' << rp.crashParameter << '\n';
|
||||
if (!rp.projectSourceDirectory.isEmpty()) {
|
||||
str << "Project: " << rp.projectSourceDirectory.toUserOutput() << '\n';
|
||||
if (!rp.projectSourceDirectory().isEmpty()) {
|
||||
str << "Project: " << rp.projectSourceDirectory().toUserOutput() << '\n';
|
||||
str << "Additional Search Directories:";
|
||||
for (const FilePath &dir : rp.additionalSearchDirectories())
|
||||
str << ' ' << dir;
|
||||
|
@@ -194,7 +194,7 @@ public:
|
||||
|
||||
bool runAsRoot() const { return m_runAsRoot; }
|
||||
|
||||
Utils::ProcessRunData debugger() const { return m_debugger; };
|
||||
Utils::ProcessRunData debugger() const { return m_debugger; }
|
||||
|
||||
void setOverrideStartScript(const Utils::FilePath &script) { m_overrideStartScript = script; }
|
||||
Utils::FilePath overrideStartScript() const { return m_overrideStartScript; }
|
||||
@@ -212,8 +212,8 @@ public:
|
||||
void setToolChainAbi(const ProjectExplorer::Abi &abi) { m_toolChainAbi = abi; }
|
||||
ProjectExplorer::Abi toolChainAbi() const { return m_toolChainAbi; }
|
||||
|
||||
Utils::FilePath projectSourceDirectory;
|
||||
Utils::FilePaths projectSourceFiles;
|
||||
Utils::FilePath projectSourceDirectory() const { return m_projectSourceDirectory; }
|
||||
Utils::FilePaths projectSourceFiles() const { return m_projectSourceFiles; }
|
||||
|
||||
// Terminal
|
||||
qint64 applicationPid = 0;
|
||||
@@ -317,6 +317,9 @@ private:
|
||||
QStringList m_debugSourceLocation; // Gdb "directory"
|
||||
Utils::FilePath m_qtSourceLocation;
|
||||
ProjectExplorer::Abi m_toolChainAbi;
|
||||
|
||||
Utils::FilePath m_projectSourceDirectory;
|
||||
Utils::FilePaths m_projectSourceFiles;
|
||||
};
|
||||
|
||||
namespace Internal {
|
||||
|
@@ -542,7 +542,7 @@ void GdbEngine::handleAsyncOutput(const QStringView asyncClass, const GdbMi &res
|
||||
ba.remove(pos1, pos3 - pos1 + 1);
|
||||
GdbMi res;
|
||||
res.fromString(ba);
|
||||
const FilePath &fileRoot = runParameters().projectSourceDirectory;
|
||||
const FilePath &fileRoot = runParameters().projectSourceDirectory();
|
||||
BreakHandler *handler = breakHandler();
|
||||
Breakpoint bp;
|
||||
for (const GdbMi &bkpt : res) {
|
||||
@@ -573,7 +573,7 @@ void GdbEngine::handleAsyncOutput(const QStringView asyncClass, const GdbMi &res
|
||||
const QString nr = bkpt["number"].data();
|
||||
BreakpointParameters br;
|
||||
br.type = BreakpointByFileAndLine;
|
||||
br.updateFromGdbOutput(bkpt, runParameters().projectSourceDirectory);
|
||||
br.updateFromGdbOutput(bkpt, runParameters().projectSourceDirectory());
|
||||
handler->handleAlienBreakpoint(nr, br);
|
||||
}
|
||||
} else if (asyncClass == u"breakpoint-deleted") {
|
||||
@@ -1237,7 +1237,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
|
||||
lineNumber = lineNumberG.toInt();
|
||||
fullName = cleanupFullName(frame["fullname"].data());
|
||||
if (fullName.isEmpty())
|
||||
fullName = runParameters().projectSourceDirectory.withNewPath(frame["file"].data());
|
||||
fullName = runParameters().projectSourceDirectory().withNewPath(frame["file"].data());
|
||||
} // found line number
|
||||
} else {
|
||||
showMessage("INVALID STOPPED REASON", LogWarning);
|
||||
@@ -1593,7 +1593,7 @@ FilePath GdbEngine::fullName(const QString &fileName)
|
||||
FilePath GdbEngine::cleanupFullName(const QString &fileName)
|
||||
{
|
||||
FilePath cleanFilePath =
|
||||
runParameters().projectSourceDirectory.withNewPath(fileName).cleanPath();
|
||||
runParameters().projectSourceDirectory().withNewPath(fileName).cleanPath();
|
||||
|
||||
// Gdb running on windows often delivers "fullnames" which
|
||||
// (a) have no drive letter and (b) are not normalized.
|
||||
@@ -2130,7 +2130,7 @@ void GdbEngine::handleInsertInterpreterBreakpoint(const DebuggerResponse &respon
|
||||
notifyBreakpointInsertOk(bp);
|
||||
} else {
|
||||
bp->setResponseId(response.data["number"].data());
|
||||
bp->updateFromGdbOutput(response.data, runParameters().projectSourceDirectory);
|
||||
bp->updateFromGdbOutput(response.data, runParameters().projectSourceDirectory());
|
||||
notifyBreakpointInsertOk(bp);
|
||||
}
|
||||
}
|
||||
@@ -2140,7 +2140,7 @@ void GdbEngine::handleInterpreterBreakpointModified(const GdbMi &data)
|
||||
int modelId = data["modelid"].toInt();
|
||||
Breakpoint bp = breakHandler()->findBreakpointByModelId(modelId);
|
||||
QTC_ASSERT(bp, return);
|
||||
bp->updateFromGdbOutput(data, runParameters().projectSourceDirectory);
|
||||
bp->updateFromGdbOutput(data, runParameters().projectSourceDirectory());
|
||||
}
|
||||
|
||||
void GdbEngine::handleWatchInsert(const DebuggerResponse &response, const Breakpoint &bp)
|
||||
@@ -2190,7 +2190,7 @@ void GdbEngine::handleBkpt(const GdbMi &bkpt, const Breakpoint &bp)
|
||||
// A sub-breakpoint.
|
||||
SubBreakpoint sub = bp->findOrCreateSubBreakpoint(nr);
|
||||
QTC_ASSERT(sub, return);
|
||||
sub->params.updateFromGdbOutput(bkpt, runParameters().projectSourceDirectory);
|
||||
sub->params.updateFromGdbOutput(bkpt, runParameters().projectSourceDirectory());
|
||||
sub->params.type = bp->type();
|
||||
if (usePseudoTracepoints && bp->isTracepoint()) {
|
||||
sub->params.tracepoint = true;
|
||||
@@ -2208,7 +2208,7 @@ void GdbEngine::handleBkpt(const GdbMi &bkpt, const Breakpoint &bp)
|
||||
const QString subnr = location["number"].data();
|
||||
SubBreakpoint sub = bp->findOrCreateSubBreakpoint(subnr);
|
||||
QTC_ASSERT(sub, return);
|
||||
sub->params.updateFromGdbOutput(location, runParameters().projectSourceDirectory);
|
||||
sub->params.updateFromGdbOutput(location, runParameters().projectSourceDirectory());
|
||||
sub->params.type = bp->type();
|
||||
if (usePseudoTracepoints && bp->isTracepoint()) {
|
||||
sub->params.tracepoint = true;
|
||||
@@ -2219,7 +2219,7 @@ void GdbEngine::handleBkpt(const GdbMi &bkpt, const Breakpoint &bp)
|
||||
|
||||
// A (the?) primary breakpoint.
|
||||
bp->setResponseId(nr);
|
||||
bp->updateFromGdbOutput(bkpt, runParameters().projectSourceDirectory);
|
||||
bp->updateFromGdbOutput(bkpt, runParameters().projectSourceDirectory());
|
||||
if (usePseudoTracepoints && bp->isTracepoint())
|
||||
bp->setMessage(bp->requestedParameters().message);
|
||||
}
|
||||
@@ -2526,7 +2526,7 @@ void GdbEngine::handleTracepointModified(const GdbMi &data)
|
||||
// A sub-breakpoint.
|
||||
QTC_ASSERT(bp, continue);
|
||||
SubBreakpoint loc = bp->findOrCreateSubBreakpoint(nr);
|
||||
loc->params.updateFromGdbOutput(bkpt, runParameters().projectSourceDirectory);
|
||||
loc->params.updateFromGdbOutput(bkpt, runParameters().projectSourceDirectory());
|
||||
loc->params.type = bp->type();
|
||||
if (bp->isTracepoint()) {
|
||||
loc->params.tracepoint = true;
|
||||
@@ -2536,7 +2536,7 @@ void GdbEngine::handleTracepointModified(const GdbMi &data)
|
||||
// A primary breakpoint.
|
||||
bp = handler->findBreakpointByResponseId(nr);
|
||||
if (bp)
|
||||
bp->updateFromGdbOutput(bkpt, runParameters().projectSourceDirectory);
|
||||
bp->updateFromGdbOutput(bkpt, runParameters().projectSourceDirectory());
|
||||
}
|
||||
}
|
||||
QTC_ASSERT(bp, return);
|
||||
|
@@ -2449,8 +2449,8 @@ FilePath QmlEngine::toFileInProject(const QUrl &fileUrl)
|
||||
{
|
||||
// make sure file finder is properly initialized
|
||||
const DebuggerRunParameters &rp = runParameters();
|
||||
d->fileFinder.setProjectDirectory(rp.projectSourceDirectory);
|
||||
d->fileFinder.setProjectFiles(rp.projectSourceFiles);
|
||||
d->fileFinder.setProjectDirectory(rp.projectSourceDirectory());
|
||||
d->fileFinder.setProjectFiles(rp.projectSourceFiles());
|
||||
d->fileFinder.setAdditionalSearchDirectories(rp.additionalSearchDirectories());
|
||||
d->fileFinder.setSysroot(rp.sysRoot());
|
||||
|
||||
|
@@ -171,7 +171,7 @@ void StackFrame::fixQrcFrame(const DebuggerRunParameters &rp)
|
||||
relativePath = relativePath.mid(1);
|
||||
relativeFile = relativeFile.withNewPath(relativePath);
|
||||
|
||||
FilePath absFile = findFile(rp.projectSourceDirectory, relativeFile);
|
||||
FilePath absFile = findFile(rp.projectSourceDirectory(), relativeFile);
|
||||
if (absFile.isEmpty())
|
||||
absFile = findFile(FilePath::fromString(QDir::currentPath()), relativeFile);
|
||||
|
||||
|
Reference in New Issue
Block a user