forked from qt-creator/qt-creator
Add Autodetection for system cdb/gdb for kits added by sdktool.
Introduced special 'auto' value for debugger binary. Change-Id: I5be4fa148ce9ded06826a7dda647c5ba402dc70a Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
This commit is contained in:
@@ -296,8 +296,27 @@ DebuggerKitInformation::DebuggerItem DebuggerKitInformation::variantToItem(const
|
||||
}
|
||||
QTC_ASSERT(v.type() == QVariant::Map, return result);
|
||||
const QVariantMap vmap = v.toMap();
|
||||
result.binary = Utils::FileName::fromString(vmap.value(QLatin1String(binaryKeyC)).toString());
|
||||
result.engineType = static_cast<DebuggerEngineType>(vmap.value(QLatin1String(engineTypeKeyC)).toInt());
|
||||
QString binary = vmap.value(QLatin1String(binaryKeyC)).toString();
|
||||
// Check for special 'auto' entry for binary written by the sdktool during
|
||||
// installation. Try to autodetect.
|
||||
if (binary == QLatin1String("auto")) {
|
||||
binary.clear();
|
||||
switch (result.engineType) {
|
||||
case Debugger::GdbEngineType: // Auto-detect system gdb on Unix
|
||||
if (Abi::hostAbi().os() != Abi::WindowsOS)
|
||||
binary = Environment::systemEnvironment().searchInPath(QLatin1String("gdb"));
|
||||
break;
|
||||
case Debugger::CdbEngineType: { // Auto-detect system CDB on Windows.
|
||||
const QPair<QString, QString> cdbs = autoDetectCdbDebugger();
|
||||
binary = cdbs.second.isEmpty() ? cdbs.first : cdbs.second;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
result.binary = Utils::FileName::fromString(binary);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -119,6 +119,7 @@ Add a Kit using the newly set up tool chain and Qt version:
|
||||
Tricky parts:
|
||||
- debuggerengine is the integer used in the enum Debugger::DebuggerEngineType
|
||||
The most important type is 1 for GDB.
|
||||
- debugger can be a absolute path or the value: 'auto'
|
||||
|
||||
- devicetype is the string returned IDevice::type()
|
||||
|
||||
|
@@ -63,6 +63,12 @@ static char TOOLCHAIN[] = "PE.Profile.ToolChain";
|
||||
static char MKSPEC[] = "QtPM4.mkSpecInformation";
|
||||
static char QT[] = "QtSupport.QtInformation";
|
||||
|
||||
AddKitOperation::AddKitOperation()
|
||||
: m_debuggerEngine(0)
|
||||
, m_debugger(QLatin1String("auto"))
|
||||
{
|
||||
}
|
||||
|
||||
QString AddKitOperation::name() const
|
||||
{
|
||||
return QLatin1String("addKit");
|
||||
|
@@ -38,6 +38,8 @@
|
||||
class AddKitOperation : public Operation
|
||||
{
|
||||
public:
|
||||
AddKitOperation();
|
||||
|
||||
QString name() const;
|
||||
QString helpText() const;
|
||||
QString argumentsHelpText() const;
|
||||
|
Reference in New Issue
Block a user