aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarek Kobus <[email protected]>2025-01-13 15:59:36 +0100
committerJarek Kobus <[email protected]>2025-01-13 15:17:23 +0000
commit218139be8d183a7721a6fedcf556f299bfae46c3 (patch)
tree3d4bdc669f50d91e26487dbb5393455e68d0412a
parent164f6fa6c341ca792150d06aee3c2c8c8eabaa56 (diff)
Debugger: Transform DebuggerRunParameters::toolChainAbi
-rw-r--r--src/plugins/android/androiddebugsupport.cpp4
-rw-r--r--src/plugins/debugger/cdb/cdbengine.cpp4
-rw-r--r--src/plugins/debugger/debuggerengine.cpp12
-rw-r--r--src/plugins/debugger/debuggerengine.h4
-rw-r--r--src/plugins/debugger/debuggerruncontrol.cpp7
-rw-r--r--src/plugins/debugger/debuggerruncontrol.h2
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp16
7 files changed, 22 insertions, 27 deletions
diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp
index df02874bcde..ef23c551664 100644
--- a/src/plugins/android/androiddebugsupport.cpp
+++ b/src/plugins/android/androiddebugsupport.cpp
@@ -128,8 +128,8 @@ public:
qCDebug(androidDebugSupportLog).noquote() << "SoLibSearchPath: " << solibSearchPath;
rp.setSymbolFile(androidAppProcessDir(target).pathAppended("app_process"));
rp.setUseExtendedRemote(true);
- QString devicePreferredAbi = apkDevicePreferredAbi(target);
- setAbi(androidAbi2Abi(devicePreferredAbi));
+ const QString devicePreferredAbi = apkDevicePreferredAbi(target);
+ rp.setToolChainAbi(androidAbi2Abi(devicePreferredAbi));
auto qt = static_cast<AndroidQtVersion *>(qtVersion);
const int minimumNdk = qt ? qt->minimumNDK() : 0;
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index 56b678a7a36..f8cf295c7bf 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -543,7 +543,7 @@ void CdbEngine::runEngine()
// else the debugger will slow down considerably.
const auto cb = [this](const DebuggerResponse &r) { handleBreakInsert(r, Breakpoint()); };
if (settings().cdbBreakOnCrtDbgReport()) {
- Abi::OSFlavor flavor = runParameters().toolChainAbi.osFlavor();
+ Abi::OSFlavor flavor = runParameters().toolChainAbi().osFlavor();
// CrtDebugReport cannot be safely resolved for vc 19
if ((flavor > Abi::WindowsMsvc2005Flavor && flavor <= Abi::WindowsMsvc2013Flavor) ||
flavor > Abi::WindowsMSysFlavor || flavor <= Abi::WindowsCEFlavor) {
@@ -837,7 +837,7 @@ void CdbEngine::jumpToAddress(quint64 address)
QString cmd;
StringInputStream str(cmd);
// PC-register depending on 64/32bit.
- str << "r " << (runParameters().toolChainAbi.wordWidth() == 64 ? "rip" : "eip") << '=';
+ str << "r " << (runParameters().toolChainAbi().wordWidth() == 64 ? "rip" : "eip") << '=';
str.setHexPrefix(true);
str.setIntegerBase(16);
str << address;
diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp
index 0a108217657..aee0ce65bb5 100644
--- a/src/plugins/debugger/debuggerengine.cpp
+++ b/src/plugins/debugger/debuggerengine.cpp
@@ -116,7 +116,7 @@ QDebug operator<<(QDebug str, const DebuggerRunParameters &rp)
<< " workingDir=" << rp.inferior().workingDirectory
<< " attachPID=" << rp.attachPid().pid()
<< " remoteChannel=" << rp.remoteChannel()
- << " abi=" << rp.toolChainAbi.toString() << '\n';
+ << " abi=" << rp.toolChainAbi().toString() << '\n';
return str;
}
@@ -183,7 +183,7 @@ DebuggerRunParameters DebuggerRunParameters::fromRunControl(ProjectExplorer::Run
params.projectSourceFiles.clear();
}
- params.toolChainAbi = ToolchainKitAspect::targetAbi(kit);
+ params.m_toolChainAbi = ToolchainKitAspect::targetAbi(kit);
bool ok = false;
const int nativeMixedOverride = qtcEnvironmentVariableIntValue("QTC_DEBUGGER_NATIVE_MIXED", &ok);
@@ -2890,7 +2890,7 @@ QString DebuggerEngine::formatStartParameters() const
QString rc;
QTextStream str(&rc);
str << "Start parameters: '" << rp.displayName() << "' mode: " << rp.startMode()
- << "\nABI: " << rp.toolChainAbi.toString() << '\n';
+ << "\nABI: " << rp.toolChainAbi().toString() << '\n';
str << "Languages: ";
if (rp.isCppDebugging())
str << "c++ ";
@@ -3006,14 +3006,14 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp)
static const Key warnOnInappropriateDebuggerKey = "DebuggerWarnOnInappropriateDebugger";
const bool warnOnRelease = settings().warnOnReleaseBuilds()
- && rp.toolChainAbi.osFlavor() != Abi::AndroidLinuxFlavor;
+ && rp.toolChainAbi().osFlavor() != Abi::AndroidLinuxFlavor;
bool warnOnInappropriateDebugger = false;
QString detailedWarning;
- switch (rp.toolChainAbi.binaryFormat()) {
+ switch (rp.toolChainAbi().binaryFormat()) {
case Abi::PEFormat: {
if (CheckableDecider(warnOnInappropriateDebuggerKey).shouldAskAgain()) {
QString preferredDebugger;
- if (rp.toolChainAbi.osFlavor() == Abi::WindowsMSysFlavor) {
+ if (rp.toolChainAbi().osFlavor() == Abi::WindowsMSysFlavor) {
if (rp.cppEngineType() == CdbEngineType)
preferredDebugger = "GDB";
} else if (rp.cppEngineType() != CdbEngineType && rp.cppEngineType() != LldbEngineType) {
diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h
index f30ebf8aa3f..3f671a0dfef 100644
--- a/src/plugins/debugger/debuggerengine.h
+++ b/src/plugins/debugger/debuggerengine.h
@@ -209,7 +209,8 @@ public:
Utils::FilePath qtSourceLocation() const { return m_qtSourceLocation; }
- ProjectExplorer::Abi toolChainAbi;
+ void setToolChainAbi(const ProjectExplorer::Abi &abi) { m_toolChainAbi = abi; }
+ ProjectExplorer::Abi toolChainAbi() const { return m_toolChainAbi; }
Utils::FilePath projectSourceDirectory;
Utils::FilePaths projectSourceFiles;
@@ -315,6 +316,7 @@ private:
Utils::FilePath m_debugInfoLocation; // Gdb "set-debug-file-directory".
QStringList m_debugSourceLocation; // Gdb "directory"
Utils::FilePath m_qtSourceLocation;
+ ProjectExplorer::Abi m_toolChainAbi;
};
namespace Internal {
diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp
index 8b511912723..a4434cb45c1 100644
--- a/src/plugins/debugger/debuggerruncontrol.cpp
+++ b/src/plugins/debugger/debuggerruncontrol.cpp
@@ -108,11 +108,6 @@ void DebuggerRunTool::setTestCase(int testCase)
m_runParameters.testCase = testCase;
}
-void DebuggerRunTool::setAbi(const Abi &abi)
-{
- m_runParameters.toolChainAbi = abi;
-}
-
void DebuggerRunTool::addQmlServerInferiorCommandLineArgumentIfNeeded()
{
d->addQmlServerInferiorCommandLineArgumentIfNeeded = true;
@@ -468,7 +463,7 @@ void DebuggerRunTool::continueAfterDebugServerStart()
const QString debuggerName = Utils::transform<QStringList>(m_engines, &DebuggerEngine::objectName).join(" ");
const QString message = Tr::tr("Starting debugger \"%1\" for ABI \"%2\"...")
- .arg(debuggerName).arg(m_runParameters.toolChainAbi.toString());
+ .arg(debuggerName).arg(m_runParameters.toolChainAbi().toString());
DebuggerMainWindow::showStatusMessage(message, 10000);
showMessage(m_engines.first()->formatStartParameters(), LogDebug);
diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h
index 2a99e4a1b8c..d4c2a4ea81f 100644
--- a/src/plugins/debugger/debuggerruncontrol.h
+++ b/src/plugins/debugger/debuggerruncontrol.h
@@ -44,8 +44,6 @@ public:
void modifyDebuggerEnvironment(const Utils::EnvironmentItems &item);
- void setAbi(const ProjectExplorer::Abi &abi);
-
DebuggerRunParameters &runParameters() { return m_runParameters; }
private:
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 2a92e4c93aa..d46c7390133 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -440,7 +440,7 @@ void GdbEngine::handleAsyncOutput(const QStringView asyncClass, const GdbMi &res
} else {
GdbMi threads = result["thread-id"];
threadsHandler()->notifyRunning(threads.data());
- if (runParameters().toolChainAbi.os() == Abi::WindowsOS) {
+ if (runParameters().toolChainAbi().os() == Abi::WindowsOS) {
// NOTE: Each created thread spits out a *running message. We completely ignore them
// on Windows, and handle only numbered responses
@@ -968,7 +968,7 @@ void GdbEngine::handleResultRecord(DebuggerResponse *response)
if (!isExpectedResult) {
const DebuggerRunParameters &rp = runParameters();
- Abi abi = rp.toolChainAbi;
+ Abi abi = rp.toolChainAbi();
if (abi.os() == Abi::WindowsOS
&& cmd.function.startsWith("attach")
&& (rp.startMode() == AttachToLocalProcess || usesTerminal()))
@@ -1358,7 +1358,7 @@ void GdbEngine::handleStop2(const GdbMi &data)
bool isStopperThread = false;
- if (rp.toolChainAbi.os() == Abi::WindowsOS
+ if (rp.toolChainAbi().os() == Abi::WindowsOS
&& usesTerminal()
&& reason == "signal-received"
&& data["signal-name"].data() == "SIGTRAP")
@@ -1421,7 +1421,7 @@ void GdbEngine::handleStop2(const GdbMi &data)
QString meaning = data["signal-meaning"].data();
// Ignore these as they are showing up regularly when
// stopping debugging.
- if (name == stopSignal(rp.toolChainAbi) || rp.expectedSignals().contains(name)) {
+ if (name == stopSignal(rp.toolChainAbi()) || rp.expectedSignals().contains(name)) {
showMessage(name + " CONSIDERED HARMLESS. CONTINUING.");
} else if (m_isQnxGdb && name == "0" && meaning == "Signal 0") {
showMessage("SIGNAL 0 CONSIDERED BOGUS.");
@@ -1695,7 +1695,7 @@ void GdbEngine::setLinuxOsAbi()
if (!HostOsInfo::isWindowsHost())
return;
const DebuggerRunParameters &rp = runParameters();
- bool isElf = (rp.toolChainAbi.binaryFormat() == Abi::ElfFormat);
+ bool isElf = (rp.toolChainAbi().binaryFormat() == Abi::ElfFormat);
if (!isElf && !rp.inferior().command.isEmpty()) {
isElf = Utils::anyOf(Abi::abisOfBinary(rp.inferior().command.executable()), [](const Abi &abi) {
return abi.binaryFormat() == Abi::ElfFormat;
@@ -3852,7 +3852,7 @@ void GdbEngine::setupEngine()
if (rp.debugger().command.isEmpty()) {
handleGdbStartFailed();
handleAdapterStartFailed(
- msgNoGdbBinaryForToolchain(rp.toolChainAbi),
+ msgNoGdbBinaryForToolchain(rp.toolChainAbi()),
Constants::DEBUGGER_COMMON_SETTINGS_ID);
return;
}
@@ -5014,7 +5014,7 @@ void GdbEngine::handleStubAttached(const DebuggerResponse &response, qint64 main
case ResultDone:
case ResultRunning:
claimInitialBreakpoints();
- if (runParameters().toolChainAbi.os() == ProjectExplorer::Abi::WindowsOS) {
+ if (runParameters().toolChainAbi().os() == ProjectExplorer::Abi::WindowsOS) {
QString errorMessage;
// Resume thread that was suspended by console stub process (see stub code).
if (winResumeThread(mainThreadId, &errorMessage)) {
@@ -5217,7 +5217,7 @@ QString GdbEngine::msgPtraceError(DebuggerStartMode sm)
QString GdbEngine::mainFunction() const
{
const DebuggerRunParameters &rp = runParameters();
- return QLatin1String(rp.toolChainAbi.os() == Abi::WindowsOS && !usesTerminal() ? "qMain" : "main");
+ return QLatin1String(rp.toolChainAbi().os() == Abi::WindowsOS && !usesTerminal() ? "qMain" : "main");
}
//