forked from qt-creator/qt-creator
		
	Remove cygwin options now that we have a GDB which was build with MinGW.
Also, remove COM port selection on windows. It is taken from the run configuration in case of Windows anyway. Reviewed-By: Friedemann Kleint
This commit is contained in:
		@@ -1710,29 +1710,6 @@ void TrkGdbAdapter::handleFirstContinue(const GdbResponse &record)
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef Q_OS_WIN
 | 
			
		||||
 | 
			
		||||
// Prepend environment of the Symbian Gdb by Cygwin '/bin'
 | 
			
		||||
static void setGdbCygwinEnvironment(const QString &cygwin, QProcess *process)
 | 
			
		||||
{
 | 
			
		||||
    if (cygwin.isEmpty() || !QFileInfo(cygwin).isDir())
 | 
			
		||||
        return;
 | 
			
		||||
    const QString cygwinBinPath = QDir::toNativeSeparators(cygwin) + QLatin1String("\\bin");
 | 
			
		||||
    QStringList env = process->environment();
 | 
			
		||||
    if (env.isEmpty())
 | 
			
		||||
        env = QProcess::systemEnvironment();
 | 
			
		||||
    const QRegExp pathPattern(QLatin1String("^PATH=.*"), Qt::CaseInsensitive);
 | 
			
		||||
    const int index = env.indexOf(pathPattern);
 | 
			
		||||
    if (index == -1)
 | 
			
		||||
        return;
 | 
			
		||||
    QString pathValue = env.at(index).mid(5);
 | 
			
		||||
    if (pathValue.startsWith(cygwinBinPath))
 | 
			
		||||
        return;
 | 
			
		||||
    env[index] = QLatin1String("PATH=") + cygwinBinPath + QLatin1Char(';');
 | 
			
		||||
    process->setEnvironment(env);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
void TrkGdbAdapter::startGdb()
 | 
			
		||||
{
 | 
			
		||||
    QTC_ASSERT(state() == AdapterStarting, qDebug() << state());
 | 
			
		||||
@@ -1762,9 +1739,6 @@ void TrkGdbAdapter::startGdb()
 | 
			
		||||
    gdbArgs.append(QLatin1String("--nx")); // Do not read .gdbinit file
 | 
			
		||||
    gdbArgs.append(QLatin1String("-i"));
 | 
			
		||||
    gdbArgs.append(QLatin1String("mi"));
 | 
			
		||||
#ifdef Q_OS_WIN
 | 
			
		||||
    setGdbCygwinEnvironment(m_options->cygwin, &m_gdbProc);
 | 
			
		||||
#endif
 | 
			
		||||
    m_gdbProc.start(m_options->gdb, gdbArgs);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -54,24 +54,6 @@ static const char *modeKeyC = "Mode";
 | 
			
		||||
static const char *blueToothDeviceKeyC = "BlueToothDevice";
 | 
			
		||||
static const char *blueToothDeviceDefaultC = "/dev/rfcomm0";
 | 
			
		||||
static const char *gdbKeyC = "gdb";
 | 
			
		||||
static const char *cygwinKeyC = "Cygwin";
 | 
			
		||||
 | 
			
		||||
static inline QString cygwinDefault()
 | 
			
		||||
{
 | 
			
		||||
#ifdef Q_OS_WIN
 | 
			
		||||
    // Some smartness to check for Cygwin
 | 
			
		||||
    static bool firstTime = true;
 | 
			
		||||
    static QString rc = QLatin1String("C:/cygwin");
 | 
			
		||||
    if (firstTime) {
 | 
			
		||||
        if (!QFileInfo(rc).isDir())
 | 
			
		||||
            rc.clear();
 | 
			
		||||
        firstTime = false;
 | 
			
		||||
    }
 | 
			
		||||
    return rc;
 | 
			
		||||
#else
 | 
			
		||||
    return QString();
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
namespace Debugger {
 | 
			
		||||
namespace Internal {
 | 
			
		||||
@@ -80,8 +62,7 @@ TrkOptions::TrkOptions() :
 | 
			
		||||
        mode(modeDefault),
 | 
			
		||||
        serialPort(QLatin1String(serialPortDefaultC)),
 | 
			
		||||
        blueToothDevice(QLatin1String(blueToothDeviceDefaultC)),
 | 
			
		||||
        gdb(QLatin1String(gdbDefaultC)),
 | 
			
		||||
        cygwin(cygwinDefault())
 | 
			
		||||
        gdb(QLatin1String(gdbDefaultC))
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -91,7 +72,6 @@ void TrkOptions::fromSettings(const QSettings *s)
 | 
			
		||||
    mode = s->value(keyRoot + QLatin1String(modeKeyC), modeDefault).toInt();
 | 
			
		||||
    serialPort = s->value(keyRoot + QLatin1String(serialPortKeyC), QLatin1String(serialPortDefaultC)).toString();
 | 
			
		||||
    gdb =  s->value(keyRoot + QLatin1String(gdbKeyC),QLatin1String(gdbDefaultC)).toString();
 | 
			
		||||
    cygwin = s->value(keyRoot + QLatin1String(cygwinKeyC), cygwinDefault()).toString();
 | 
			
		||||
    blueToothDevice = s->value(keyRoot + QLatin1String(blueToothDeviceKeyC), QLatin1String(blueToothDeviceDefaultC)).toString();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -102,7 +82,6 @@ void TrkOptions::toSettings(QSettings *s) const
 | 
			
		||||
    s->setValue(QLatin1String(serialPortKeyC), serialPort);
 | 
			
		||||
    s->setValue(QLatin1String(blueToothDeviceKeyC), blueToothDevice);
 | 
			
		||||
    s->setValue(QLatin1String(gdbKeyC), gdb);
 | 
			
		||||
    s->setValue(QLatin1String(cygwinKeyC), cygwin);
 | 
			
		||||
    s->endGroup();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -117,10 +96,6 @@ bool TrkOptions::check(QString *errorMessage) const
 | 
			
		||||
        *errorMessage = QCoreApplication::translate("TrkOptions", "The Symbian gdb executable '%1' could not be found in the search path.").arg(gdb);
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    if (!cygwin.isEmpty() && !QFileInfo(cygwin).isDir()) {
 | 
			
		||||
        *errorMessage = QCoreApplication::translate("TrkOptions", "The Cygwin directory '%1' does not exist.").arg(cygwin);
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -129,8 +104,7 @@ bool TrkOptions::equals(const  TrkOptions &o) const
 | 
			
		||||
    return mode == o.mode
 | 
			
		||||
            && serialPort == o.serialPort
 | 
			
		||||
            && blueToothDevice == o.blueToothDevice
 | 
			
		||||
            && gdb == o.gdb
 | 
			
		||||
            && cygwin == o.cygwin;
 | 
			
		||||
            && gdb == o.gdb;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QStringList TrkOptions::serialPorts()
 | 
			
		||||
 
 | 
			
		||||
@@ -40,8 +40,7 @@ namespace Debugger {
 | 
			
		||||
namespace Internal {
 | 
			
		||||
 | 
			
		||||
/* Parameter to be used for debugging S60 via TRK.
 | 
			
		||||
 * GDB is a Symbian-ARM Gdb. It is Cygwin-built on Windows; the cygwin
 | 
			
		||||
 * location 'x/bin' will prepended to the execution path.
 | 
			
		||||
 * GDB is a Symbian-ARM Gdb.
 | 
			
		||||
 * Communication happens either via BlueTooth (Linux only) or
 | 
			
		||||
 * serial ports. */
 | 
			
		||||
 | 
			
		||||
@@ -64,7 +63,6 @@ struct TrkOptions
 | 
			
		||||
    QString serialPort;
 | 
			
		||||
    QString blueToothDevice;
 | 
			
		||||
    QString gdb;
 | 
			
		||||
    QString cygwin; // ignored on Linux
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
inline bool operator==(const TrkOptions &o1, const TrkOptions &o2)
 | 
			
		||||
 
 | 
			
		||||
@@ -41,16 +41,12 @@ TrkOptionsWidget::TrkOptionsWidget(QWidget *parent) :
 | 
			
		||||
{
 | 
			
		||||
    ui->setupUi(this);
 | 
			
		||||
    ui->gdbChooser->setExpectedKind(Utils::PathChooser::Command);
 | 
			
		||||
    ui->cygwinChooser->setExpectedKind(Utils::PathChooser::Directory);
 | 
			
		||||
    ui->blueToothComboBox->addItems(TrkOptions::blueToothDevices());
 | 
			
		||||
    ui->serialComboBox->addItems(TrkOptions::serialPorts());
 | 
			
		||||
    connect(ui->commComboBox, SIGNAL(currentIndexChanged(int)), ui->commStackedWidget, SLOT(setCurrentIndex(int)));
 | 
			
		||||
    // No bluetooth on Windows yet...
 | 
			
		||||
#ifdef Q_OS_WIN
 | 
			
		||||
    ui->commComboBox->setEnabled(false);
 | 
			
		||||
#else
 | 
			
		||||
    ui->cygwinChooser->setVisible(false);
 | 
			
		||||
    ui->cygwinLabel->setVisible(false);
 | 
			
		||||
    ui->commGroupBox->setVisible(false);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -78,7 +74,6 @@ void TrkOptionsWidget::setTrkOptions(const TrkOptions &o)
 | 
			
		||||
    const int serialPortIndex = qMax(0, ui->serialComboBox->findText(o.serialPort));
 | 
			
		||||
    ui->serialComboBox->setCurrentIndex(serialPortIndex);
 | 
			
		||||
    ui->gdbChooser->setPath(o.gdb);
 | 
			
		||||
    ui->cygwinChooser->setPath(o.cygwin);
 | 
			
		||||
    const int blueToothIndex = qMax(0, ui->blueToothComboBox->findText(o.blueToothDevice));
 | 
			
		||||
    ui->blueToothComboBox->setCurrentIndex(blueToothIndex);
 | 
			
		||||
}
 | 
			
		||||
@@ -88,7 +83,6 @@ TrkOptions TrkOptionsWidget::trkOptions() const
 | 
			
		||||
    TrkOptions rc;
 | 
			
		||||
    rc.mode = ui->commComboBox->currentIndex();
 | 
			
		||||
    rc.gdb = ui->gdbChooser->path();
 | 
			
		||||
    rc.cygwin = ui->cygwinChooser->path();
 | 
			
		||||
    rc.blueToothDevice = ui->blueToothComboBox->currentText();
 | 
			
		||||
    rc.serialPort = ui->serialComboBox->currentText();
 | 
			
		||||
    return rc;
 | 
			
		||||
 
 | 
			
		||||
@@ -20,6 +20,9 @@
 | 
			
		||||
      <string>Gdb</string>
 | 
			
		||||
     </property>
 | 
			
		||||
     <layout class="QFormLayout" name="formLayout">
 | 
			
		||||
      <property name="fieldGrowthPolicy">
 | 
			
		||||
       <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
 | 
			
		||||
      </property>
 | 
			
		||||
      <item row="0" column="0">
 | 
			
		||||
       <widget class="QLabel" name="gdbLabel">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
@@ -30,16 +33,6 @@
 | 
			
		||||
      <item row="0" column="1">
 | 
			
		||||
       <widget class="Utils::PathChooser" name="gdbChooser" native="true"/>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="1" column="0">
 | 
			
		||||
       <widget class="QLabel" name="cygwinLabel">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>Cygwin location:</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="1" column="1">
 | 
			
		||||
       <widget class="Utils::PathChooser" name="cygwinChooser" native="true"/>
 | 
			
		||||
      </item>
 | 
			
		||||
     </layout>
 | 
			
		||||
    </widget>
 | 
			
		||||
   </item>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user