forked from qt-creator/qt-creator
Debugger: Transform DebuggerRunParameters::toolChainAbi
Task-number: QTCREATORBUG-29168 Change-Id: I679e62ef45b726194c1957d9022e0d7a77cff1bd Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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) {
|
||||
|
@@ -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 {
|
||||
|
@@ -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);
|
||||
|
@@ -44,8 +44,6 @@ public:
|
||||
|
||||
void modifyDebuggerEnvironment(const Utils::EnvironmentItems &item);
|
||||
|
||||
void setAbi(const ProjectExplorer::Abi &abi);
|
||||
|
||||
DebuggerRunParameters &runParameters() { return m_runParameters; }
|
||||
|
||||
private:
|
||||
|
@@ -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");
|
||||
}
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user