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:
Daniel Molkentin
2009-10-09 14:20:14 +02:00
parent 7856541d0e
commit 555f8a02ec
5 changed files with 7 additions and 74 deletions

View File

@@ -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() void TrkGdbAdapter::startGdb()
{ {
QTC_ASSERT(state() == AdapterStarting, qDebug() << state()); 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("--nx")); // Do not read .gdbinit file
gdbArgs.append(QLatin1String("-i")); gdbArgs.append(QLatin1String("-i"));
gdbArgs.append(QLatin1String("mi")); gdbArgs.append(QLatin1String("mi"));
#ifdef Q_OS_WIN
setGdbCygwinEnvironment(m_options->cygwin, &m_gdbProc);
#endif
m_gdbProc.start(m_options->gdb, gdbArgs); m_gdbProc.start(m_options->gdb, gdbArgs);
} }

View File

@@ -54,24 +54,6 @@ static const char *modeKeyC = "Mode";
static const char *blueToothDeviceKeyC = "BlueToothDevice"; static const char *blueToothDeviceKeyC = "BlueToothDevice";
static const char *blueToothDeviceDefaultC = "/dev/rfcomm0"; static const char *blueToothDeviceDefaultC = "/dev/rfcomm0";
static const char *gdbKeyC = "gdb"; 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 Debugger {
namespace Internal { namespace Internal {
@@ -80,8 +62,7 @@ TrkOptions::TrkOptions() :
mode(modeDefault), mode(modeDefault),
serialPort(QLatin1String(serialPortDefaultC)), serialPort(QLatin1String(serialPortDefaultC)),
blueToothDevice(QLatin1String(blueToothDeviceDefaultC)), blueToothDevice(QLatin1String(blueToothDeviceDefaultC)),
gdb(QLatin1String(gdbDefaultC)), gdb(QLatin1String(gdbDefaultC))
cygwin(cygwinDefault())
{ {
} }
@@ -91,7 +72,6 @@ void TrkOptions::fromSettings(const QSettings *s)
mode = s->value(keyRoot + QLatin1String(modeKeyC), modeDefault).toInt(); mode = s->value(keyRoot + QLatin1String(modeKeyC), modeDefault).toInt();
serialPort = s->value(keyRoot + QLatin1String(serialPortKeyC), QLatin1String(serialPortDefaultC)).toString(); serialPort = s->value(keyRoot + QLatin1String(serialPortKeyC), QLatin1String(serialPortDefaultC)).toString();
gdb = s->value(keyRoot + QLatin1String(gdbKeyC),QLatin1String(gdbDefaultC)).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(); 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(serialPortKeyC), serialPort);
s->setValue(QLatin1String(blueToothDeviceKeyC), blueToothDevice); s->setValue(QLatin1String(blueToothDeviceKeyC), blueToothDevice);
s->setValue(QLatin1String(gdbKeyC), gdb); s->setValue(QLatin1String(gdbKeyC), gdb);
s->setValue(QLatin1String(cygwinKeyC), cygwin);
s->endGroup(); 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); *errorMessage = QCoreApplication::translate("TrkOptions", "The Symbian gdb executable '%1' could not be found in the search path.").arg(gdb);
return false; 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; return true;
} }
@@ -129,8 +104,7 @@ bool TrkOptions::equals(const TrkOptions &o) const
return mode == o.mode return mode == o.mode
&& serialPort == o.serialPort && serialPort == o.serialPort
&& blueToothDevice == o.blueToothDevice && blueToothDevice == o.blueToothDevice
&& gdb == o.gdb && gdb == o.gdb;
&& cygwin == o.cygwin;
} }
QStringList TrkOptions::serialPorts() QStringList TrkOptions::serialPorts()

View File

@@ -40,8 +40,7 @@ namespace Debugger {
namespace Internal { namespace Internal {
/* Parameter to be used for debugging S60 via TRK. /* Parameter to be used for debugging S60 via TRK.
* GDB is a Symbian-ARM Gdb. It is Cygwin-built on Windows; the cygwin * GDB is a Symbian-ARM Gdb.
* location 'x/bin' will prepended to the execution path.
* Communication happens either via BlueTooth (Linux only) or * Communication happens either via BlueTooth (Linux only) or
* serial ports. */ * serial ports. */
@@ -64,7 +63,6 @@ struct TrkOptions
QString serialPort; QString serialPort;
QString blueToothDevice; QString blueToothDevice;
QString gdb; QString gdb;
QString cygwin; // ignored on Linux
}; };
inline bool operator==(const TrkOptions &o1, const TrkOptions &o2) inline bool operator==(const TrkOptions &o1, const TrkOptions &o2)

View File

@@ -41,16 +41,12 @@ TrkOptionsWidget::TrkOptionsWidget(QWidget *parent) :
{ {
ui->setupUi(this); ui->setupUi(this);
ui->gdbChooser->setExpectedKind(Utils::PathChooser::Command); ui->gdbChooser->setExpectedKind(Utils::PathChooser::Command);
ui->cygwinChooser->setExpectedKind(Utils::PathChooser::Directory);
ui->blueToothComboBox->addItems(TrkOptions::blueToothDevices()); ui->blueToothComboBox->addItems(TrkOptions::blueToothDevices());
ui->serialComboBox->addItems(TrkOptions::serialPorts()); ui->serialComboBox->addItems(TrkOptions::serialPorts());
connect(ui->commComboBox, SIGNAL(currentIndexChanged(int)), ui->commStackedWidget, SLOT(setCurrentIndex(int))); connect(ui->commComboBox, SIGNAL(currentIndexChanged(int)), ui->commStackedWidget, SLOT(setCurrentIndex(int)));
// No bluetooth on Windows yet... // No bluetooth on Windows yet...
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
ui->commComboBox->setEnabled(false); ui->commGroupBox->setVisible(false);
#else
ui->cygwinChooser->setVisible(false);
ui->cygwinLabel->setVisible(false);
#endif #endif
} }
@@ -78,7 +74,6 @@ void TrkOptionsWidget::setTrkOptions(const TrkOptions &o)
const int serialPortIndex = qMax(0, ui->serialComboBox->findText(o.serialPort)); const int serialPortIndex = qMax(0, ui->serialComboBox->findText(o.serialPort));
ui->serialComboBox->setCurrentIndex(serialPortIndex); ui->serialComboBox->setCurrentIndex(serialPortIndex);
ui->gdbChooser->setPath(o.gdb); ui->gdbChooser->setPath(o.gdb);
ui->cygwinChooser->setPath(o.cygwin);
const int blueToothIndex = qMax(0, ui->blueToothComboBox->findText(o.blueToothDevice)); const int blueToothIndex = qMax(0, ui->blueToothComboBox->findText(o.blueToothDevice));
ui->blueToothComboBox->setCurrentIndex(blueToothIndex); ui->blueToothComboBox->setCurrentIndex(blueToothIndex);
} }
@@ -88,7 +83,6 @@ TrkOptions TrkOptionsWidget::trkOptions() const
TrkOptions rc; TrkOptions rc;
rc.mode = ui->commComboBox->currentIndex(); rc.mode = ui->commComboBox->currentIndex();
rc.gdb = ui->gdbChooser->path(); rc.gdb = ui->gdbChooser->path();
rc.cygwin = ui->cygwinChooser->path();
rc.blueToothDevice = ui->blueToothComboBox->currentText(); rc.blueToothDevice = ui->blueToothComboBox->currentText();
rc.serialPort = ui->serialComboBox->currentText(); rc.serialPort = ui->serialComboBox->currentText();
return rc; return rc;

View File

@@ -20,6 +20,9 @@
<string>Gdb</string> <string>Gdb</string>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="gdbLabel"> <widget class="QLabel" name="gdbLabel">
<property name="text"> <property name="text">
@@ -30,16 +33,6 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="Utils::PathChooser" name="gdbChooser" native="true"/> <widget class="Utils::PathChooser" name="gdbChooser" native="true"/>
</item> </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> </layout>
</widget> </widget>
</item> </item>