Debugger: Transform a few fields of DebuggerRunParameters

Transform debugInfoLocation, debugSourceLocation and
qtSourceLocation.

Task-number: QTCREATORBUG-29168
Change-Id: Ia8c93092d1e8ad937d9aa0ab4b4208609772e9be
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2025-01-13 15:48:24 +01:00
parent 7d5126b431
commit 164f6fa6c3
7 changed files with 22 additions and 22 deletions

View File

@@ -415,7 +415,7 @@ void StartApplicationDialog::run(bool attachRemote)
rp.setRemoteChannel(dev->sshParameters().host(), newParameters.serverPort);
rp.setDisplayName(newParameters.displayName());
rp.setBreakOnMain(newParameters.breakAtMain);
debugger->setDebugInfoLocation(newParameters.debugInfoLocation);
rp.setDebugInfoLocation(newParameters.debugInfoLocation);
rp.setInferior(newParameters.runnable);
rp.setCommandsAfterConnect(newParameters.serverInitCommands);
rp.setCommandsForReset(newParameters.serverResetCommands);

View File

@@ -143,7 +143,7 @@ DebuggerRunParameters DebuggerRunParameters::fromRunControl(ProjectExplorer::Run
params.m_version = DebuggerKitAspect::version(kit);
if (QtSupport::QtVersion *qtVersion = QtSupport::QtKitAspect::qtVersion(kit))
params.qtSourceLocation = qtVersion->sourcePath();
params.m_qtSourceLocation = qtVersion->sourcePath();
if (auto aspect = runControl->aspectData<DebuggerRunConfigurationAspect>()) {
if (!aspect->useCppDebugger)
@@ -243,13 +243,13 @@ Result DebuggerRunParameters::fixupParameters(ProjectExplorer::RunControl *runCo
}
if (settings().autoEnrichParameters()) {
if (debugInfoLocation.isEmpty())
debugInfoLocation = m_sysRoot / "/usr/lib/debug";
if (debugSourceLocation.isEmpty()) {
if (m_debugInfoLocation.isEmpty())
m_debugInfoLocation = m_sysRoot / "/usr/lib/debug";
if (m_debugSourceLocation.isEmpty()) {
const QString base = m_sysRoot.toUrlishString() + "/usr/src/debug/";
debugSourceLocation.append(base + "qt5base/src/corelib");
debugSourceLocation.append(base + "qt5base/src/gui");
debugSourceLocation.append(base + "qt5base/src/network");
m_debugSourceLocation.append(base + "qt5base/src/corelib");
m_debugSourceLocation.append(base + "qt5base/src/gui");
m_debugSourceLocation.append(base + "qt5base/src/network");
}
}
@@ -2923,7 +2923,7 @@ QString DebuggerEngine::formatStartParameters() const
if (!rp.qmlServer().host().isEmpty())
str << "QML server: " << rp.qmlServer().host() << ':' << rp.qmlServer().port() << '\n';
str << "Sysroot: " << rp.sysRoot() << '\n';
str << "Debug Source Location: " << rp.debugSourceLocation.join(':') << '\n';
str << "Debug Source Location: " << rp.debugSourceLocation().join(':') << '\n';
return rc;
}

View File

@@ -202,9 +202,13 @@ public:
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;
void setDebugInfoLocation(const Utils::FilePath &location) { m_debugInfoLocation = location; }
Utils::FilePath debugInfoLocation() const { return m_debugInfoLocation; }
QStringList debugSourceLocation() const { return m_debugSourceLocation; }
Utils::FilePath qtSourceLocation() const { return m_qtSourceLocation; }
ProjectExplorer::Abi toolChainAbi;
Utils::FilePath projectSourceDirectory;
@@ -308,6 +312,9 @@ private:
Utils::FilePath m_overrideStartScript; // Used in attach to core and remote debugging
QString m_startMessage; // First status message shown.
Utils::FilePath m_debugInfoLocation; // Gdb "set-debug-file-directory".
QStringList m_debugSourceLocation; // Gdb "directory"
Utils::FilePath m_qtSourceLocation;
};
namespace Internal {

View File

@@ -103,11 +103,6 @@ public:
} // namespace Internal
void DebuggerRunTool::setDebugInfoLocation(const FilePath &debugInfoLocation)
{
m_runParameters.debugInfoLocation = debugInfoLocation;
}
void DebuggerRunTool::setTestCase(int testCase)
{
m_runParameters.testCase = testCase;

View File

@@ -34,8 +34,6 @@ public:
void setUseDebugServer(Utils::ProcessHandle attachPid, bool essential, bool useMulti);
void setDebugInfoLocation(const Utils::FilePath &debugInfoLocation);
void setTestCase(int testCase);
void kickoffTerminalProcess();

View File

@@ -419,7 +419,7 @@ void DebuggerSourcePathMappingWidget::slotEditTargetFieldChanged()
SourcePathMap mergePlatformQtPath(const DebuggerRunParameters &sp, const SourcePathMap &in)
{
static const QString qglobal = "qtbase/src/corelib/global/qglobal.h";
const FilePath sourceLocation = sp.qtSourceLocation;
const FilePath sourceLocation = sp.qtSourceLocation();
if (!(sourceLocation / qglobal).exists())
return in;

View File

@@ -3964,7 +3964,7 @@ void GdbEngine::handleGdbStarted()
}
// Spaces just will not work.
for (const QString &src : rp.debugSourceLocation) {
for (const QString &src : rp.debugSourceLocation()) {
if (QDir(src).exists())
runCommand({"directory " + src});
else
@@ -4214,7 +4214,7 @@ void GdbEngine::handleInferiorPrepared()
void GdbEngine::handleDebugInfoLocation(const DebuggerResponse &response)
{
if (response.resultClass == ResultDone) {
const FilePath debugInfoLocation = runParameters().debugInfoLocation;
const FilePath debugInfoLocation = runParameters().debugInfoLocation();
if (!debugInfoLocation.isEmpty() && debugInfoLocation.exists()) {
const QString curDebugInfoLocations = response.consoleStreamOutput.split('"').value(1);
QString cmd = "set debug-file-directory " + debugInfoLocation.path();