forked from qt-creator/qt-creator
Remove ToolChain::suggestedDebugger()
And inline it in AndroidConfigurations, which is the only place that made use of suggestedDebugger() Change-Id: I87f135b5d115adb7e46b0f009c5853221e9a3daa Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -948,7 +948,7 @@ void AndroidConfigurations::removeOldToolChains()
|
||||
|
||||
static QVariant findOrRegisterDebugger(ToolChain *tc)
|
||||
{
|
||||
const FilePath command = tc->suggestedDebugger();
|
||||
const FilePath command = AndroidConfigurations::currentConfig().gdbPath(tc->targetAbi());
|
||||
// check if the debugger is already registered, but ignoring the display name
|
||||
const Debugger::DebuggerItem *existing = Debugger::DebuggerItemManager::findByCommand(command);
|
||||
if (existing && existing->engineType() == Debugger::GdbEngineType && existing->isAutoDetected()
|
||||
@@ -956,7 +956,7 @@ static QVariant findOrRegisterDebugger(ToolChain *tc)
|
||||
return existing->id();
|
||||
// debugger not found, register a new one
|
||||
Debugger::DebuggerItem debugger;
|
||||
debugger.setCommand(tc->suggestedDebugger());
|
||||
debugger.setCommand(command);
|
||||
debugger.setEngineType(Debugger::GdbEngineType);
|
||||
debugger.setUnexpandedDisplayName(
|
||||
AndroidConfigurations::tr("Android Debugger for %1").arg(tc->displayName()));
|
||||
|
@@ -105,12 +105,6 @@ void AndroidToolChain::addToEnvironment(Environment &env) const
|
||||
AndroidConfigurations::currentConfig().sdkLocation().toString());
|
||||
}
|
||||
|
||||
FilePath AndroidToolChain::suggestedDebugger() const
|
||||
{
|
||||
// TODO: Make use of LLDB if available.
|
||||
return AndroidConfigurations::currentConfig().gdbPath(targetAbi());
|
||||
}
|
||||
|
||||
FilePath AndroidToolChain::suggestedGdbServer() const
|
||||
{
|
||||
return AndroidConfigurations::currentConfig().gdbServer(targetAbi());
|
||||
|
@@ -42,7 +42,6 @@ public:
|
||||
bool isValid() const override;
|
||||
void addToEnvironment(Utils::Environment &env) const override;
|
||||
|
||||
Utils::FilePath suggestedDebugger() const override;
|
||||
Utils::FilePath suggestedGdbServer() const;
|
||||
QStringList suggestedMkspecList() const override;
|
||||
Utils::FilePath makeCommand(const Utils::Environment &environment) const override;
|
||||
|
@@ -709,7 +709,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers()
|
||||
Environment env = Environment::systemEnvironment();
|
||||
if (tc) {
|
||||
tc->addToEnvironment(env); // Find MinGW gdb in toolchain environment.
|
||||
QString path = tc->suggestedDebugger().toString();
|
||||
QString path = tc->suggestedDebugger().toString(); // Won't compile
|
||||
if (!path.isEmpty()) {
|
||||
const QFileInfo fi(path);
|
||||
if (!fi.isAbsolute())
|
||||
|
@@ -169,11 +169,6 @@ QStringList ToolChain::suggestedMkspecList() const
|
||||
return {};
|
||||
}
|
||||
|
||||
Utils::FilePath ToolChain::suggestedDebugger() const
|
||||
{
|
||||
return ToolChainManager::defaultDebugger(targetAbi());
|
||||
}
|
||||
|
||||
Core::Id ToolChain::typeId() const
|
||||
{
|
||||
return d->m_typeId;
|
||||
|
@@ -99,7 +99,6 @@ public:
|
||||
QByteArray id() const;
|
||||
|
||||
virtual QStringList suggestedMkspecList() const;
|
||||
virtual Utils::FilePath suggestedDebugger() const;
|
||||
|
||||
Core::Id typeId() const;
|
||||
virtual QString typeDisplayName() const = 0;
|
||||
|
@@ -63,7 +63,6 @@ class ToolChainManagerPrivate
|
||||
public:
|
||||
~ToolChainManagerPrivate();
|
||||
|
||||
QMap<QString, FilePath> m_abiToDebugger;
|
||||
std::unique_ptr<ToolChainSettingsAccessor> m_accessor;
|
||||
|
||||
QList<ToolChain *> m_toolChains; // prioritized List
|
||||
@@ -186,11 +185,6 @@ ToolChain *ToolChainManager::findToolChain(const QByteArray &id)
|
||||
return tc;
|
||||
}
|
||||
|
||||
FilePath ToolChainManager::defaultDebugger(const Abi &abi)
|
||||
{
|
||||
return d->m_abiToDebugger.value(abi.toString());
|
||||
}
|
||||
|
||||
bool ToolChainManager::isLoaded()
|
||||
{
|
||||
return bool(d->m_accessor);
|
||||
|
@@ -68,8 +68,6 @@ public:
|
||||
static QList<ToolChain *> findToolChains(const Abi &abi);
|
||||
static ToolChain *findToolChain(const QByteArray &id);
|
||||
|
||||
static Utils::FilePath defaultDebugger(const Abi &abi);
|
||||
|
||||
static bool isLoaded();
|
||||
|
||||
static bool registerToolChain(ToolChain *tc);
|
||||
|
Reference in New Issue
Block a user