forked from qt-creator/qt-creator
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:
@@ -415,7 +415,7 @@ void StartApplicationDialog::run(bool attachRemote)
|
|||||||
rp.setRemoteChannel(dev->sshParameters().host(), newParameters.serverPort);
|
rp.setRemoteChannel(dev->sshParameters().host(), newParameters.serverPort);
|
||||||
rp.setDisplayName(newParameters.displayName());
|
rp.setDisplayName(newParameters.displayName());
|
||||||
rp.setBreakOnMain(newParameters.breakAtMain);
|
rp.setBreakOnMain(newParameters.breakAtMain);
|
||||||
debugger->setDebugInfoLocation(newParameters.debugInfoLocation);
|
rp.setDebugInfoLocation(newParameters.debugInfoLocation);
|
||||||
rp.setInferior(newParameters.runnable);
|
rp.setInferior(newParameters.runnable);
|
||||||
rp.setCommandsAfterConnect(newParameters.serverInitCommands);
|
rp.setCommandsAfterConnect(newParameters.serverInitCommands);
|
||||||
rp.setCommandsForReset(newParameters.serverResetCommands);
|
rp.setCommandsForReset(newParameters.serverResetCommands);
|
||||||
|
@@ -143,7 +143,7 @@ DebuggerRunParameters DebuggerRunParameters::fromRunControl(ProjectExplorer::Run
|
|||||||
params.m_version = DebuggerKitAspect::version(kit);
|
params.m_version = DebuggerKitAspect::version(kit);
|
||||||
|
|
||||||
if (QtSupport::QtVersion *qtVersion = QtSupport::QtKitAspect::qtVersion(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 (auto aspect = runControl->aspectData<DebuggerRunConfigurationAspect>()) {
|
||||||
if (!aspect->useCppDebugger)
|
if (!aspect->useCppDebugger)
|
||||||
@@ -243,13 +243,13 @@ Result DebuggerRunParameters::fixupParameters(ProjectExplorer::RunControl *runCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (settings().autoEnrichParameters()) {
|
if (settings().autoEnrichParameters()) {
|
||||||
if (debugInfoLocation.isEmpty())
|
if (m_debugInfoLocation.isEmpty())
|
||||||
debugInfoLocation = m_sysRoot / "/usr/lib/debug";
|
m_debugInfoLocation = m_sysRoot / "/usr/lib/debug";
|
||||||
if (debugSourceLocation.isEmpty()) {
|
if (m_debugSourceLocation.isEmpty()) {
|
||||||
const QString base = m_sysRoot.toUrlishString() + "/usr/src/debug/";
|
const QString base = m_sysRoot.toUrlishString() + "/usr/src/debug/";
|
||||||
debugSourceLocation.append(base + "qt5base/src/corelib");
|
m_debugSourceLocation.append(base + "qt5base/src/corelib");
|
||||||
debugSourceLocation.append(base + "qt5base/src/gui");
|
m_debugSourceLocation.append(base + "qt5base/src/gui");
|
||||||
debugSourceLocation.append(base + "qt5base/src/network");
|
m_debugSourceLocation.append(base + "qt5base/src/network");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2923,7 +2923,7 @@ QString DebuggerEngine::formatStartParameters() const
|
|||||||
if (!rp.qmlServer().host().isEmpty())
|
if (!rp.qmlServer().host().isEmpty())
|
||||||
str << "QML server: " << rp.qmlServer().host() << ':' << rp.qmlServer().port() << '\n';
|
str << "QML server: " << rp.qmlServer().host() << ':' << rp.qmlServer().port() << '\n';
|
||||||
str << "Sysroot: " << rp.sysRoot() << '\n';
|
str << "Sysroot: " << rp.sysRoot() << '\n';
|
||||||
str << "Debug Source Location: " << rp.debugSourceLocation.join(':') << '\n';
|
str << "Debug Source Location: " << rp.debugSourceLocation().join(':') << '\n';
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -202,9 +202,13 @@ public:
|
|||||||
void setStartMessage(const QString &msg) { m_startMessage = msg; }
|
void setStartMessage(const QString &msg) { m_startMessage = msg; }
|
||||||
// FIXME: Add a startMessage() getter and use it.
|
// FIXME: Add a startMessage() getter and use it.
|
||||||
|
|
||||||
Utils::FilePath debugInfoLocation; // Gdb "set-debug-file-directory".
|
void setDebugInfoLocation(const Utils::FilePath &location) { m_debugInfoLocation = location; }
|
||||||
QStringList debugSourceLocation; // Gdb "directory"
|
Utils::FilePath debugInfoLocation() const { return m_debugInfoLocation; }
|
||||||
Utils::FilePath qtSourceLocation;
|
|
||||||
|
QStringList debugSourceLocation() const { return m_debugSourceLocation; }
|
||||||
|
|
||||||
|
Utils::FilePath qtSourceLocation() const { return m_qtSourceLocation; }
|
||||||
|
|
||||||
ProjectExplorer::Abi toolChainAbi;
|
ProjectExplorer::Abi toolChainAbi;
|
||||||
|
|
||||||
Utils::FilePath projectSourceDirectory;
|
Utils::FilePath projectSourceDirectory;
|
||||||
@@ -308,6 +312,9 @@ private:
|
|||||||
Utils::FilePath m_overrideStartScript; // Used in attach to core and remote debugging
|
Utils::FilePath m_overrideStartScript; // Used in attach to core and remote debugging
|
||||||
|
|
||||||
QString m_startMessage; // First status message shown.
|
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 {
|
namespace Internal {
|
||||||
|
@@ -103,11 +103,6 @@ public:
|
|||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
void DebuggerRunTool::setDebugInfoLocation(const FilePath &debugInfoLocation)
|
|
||||||
{
|
|
||||||
m_runParameters.debugInfoLocation = debugInfoLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebuggerRunTool::setTestCase(int testCase)
|
void DebuggerRunTool::setTestCase(int testCase)
|
||||||
{
|
{
|
||||||
m_runParameters.testCase = testCase;
|
m_runParameters.testCase = testCase;
|
||||||
|
@@ -34,8 +34,6 @@ public:
|
|||||||
|
|
||||||
void setUseDebugServer(Utils::ProcessHandle attachPid, bool essential, bool useMulti);
|
void setUseDebugServer(Utils::ProcessHandle attachPid, bool essential, bool useMulti);
|
||||||
|
|
||||||
void setDebugInfoLocation(const Utils::FilePath &debugInfoLocation);
|
|
||||||
|
|
||||||
void setTestCase(int testCase);
|
void setTestCase(int testCase);
|
||||||
|
|
||||||
void kickoffTerminalProcess();
|
void kickoffTerminalProcess();
|
||||||
|
@@ -419,7 +419,7 @@ void DebuggerSourcePathMappingWidget::slotEditTargetFieldChanged()
|
|||||||
SourcePathMap mergePlatformQtPath(const DebuggerRunParameters &sp, const SourcePathMap &in)
|
SourcePathMap mergePlatformQtPath(const DebuggerRunParameters &sp, const SourcePathMap &in)
|
||||||
{
|
{
|
||||||
static const QString qglobal = "qtbase/src/corelib/global/qglobal.h";
|
static const QString qglobal = "qtbase/src/corelib/global/qglobal.h";
|
||||||
const FilePath sourceLocation = sp.qtSourceLocation;
|
const FilePath sourceLocation = sp.qtSourceLocation();
|
||||||
if (!(sourceLocation / qglobal).exists())
|
if (!(sourceLocation / qglobal).exists())
|
||||||
return in;
|
return in;
|
||||||
|
|
||||||
|
@@ -3964,7 +3964,7 @@ void GdbEngine::handleGdbStarted()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Spaces just will not work.
|
// Spaces just will not work.
|
||||||
for (const QString &src : rp.debugSourceLocation) {
|
for (const QString &src : rp.debugSourceLocation()) {
|
||||||
if (QDir(src).exists())
|
if (QDir(src).exists())
|
||||||
runCommand({"directory " + src});
|
runCommand({"directory " + src});
|
||||||
else
|
else
|
||||||
@@ -4214,7 +4214,7 @@ void GdbEngine::handleInferiorPrepared()
|
|||||||
void GdbEngine::handleDebugInfoLocation(const DebuggerResponse &response)
|
void GdbEngine::handleDebugInfoLocation(const DebuggerResponse &response)
|
||||||
{
|
{
|
||||||
if (response.resultClass == ResultDone) {
|
if (response.resultClass == ResultDone) {
|
||||||
const FilePath debugInfoLocation = runParameters().debugInfoLocation;
|
const FilePath debugInfoLocation = runParameters().debugInfoLocation();
|
||||||
if (!debugInfoLocation.isEmpty() && debugInfoLocation.exists()) {
|
if (!debugInfoLocation.isEmpty() && debugInfoLocation.exists()) {
|
||||||
const QString curDebugInfoLocations = response.consoleStreamOutput.split('"').value(1);
|
const QString curDebugInfoLocations = response.consoleStreamOutput.split('"').value(1);
|
||||||
QString cmd = "set debug-file-directory " + debugInfoLocation.path();
|
QString cmd = "set debug-file-directory " + debugInfoLocation.path();
|
||||||
|
Reference in New Issue
Block a user