diff --git a/src/plugins/coreplugin/generalsettings.ui b/src/plugins/coreplugin/generalsettings.ui index e2b84b732254b290c4e0613c966db69a1339dbcd..269d14616572bb2e37ee16efb683c7d17b8bfb62 100644 --- a/src/plugins/coreplugin/generalsettings.ui +++ b/src/plugins/coreplugin/generalsettings.ui @@ -183,7 +183,7 @@ </item> <item> <property name="text"> - <string>Reload all unmodified files</string> + <string>Reload all modified files</string> </property> </item> <item> diff --git a/src/plugins/cvs/settingspage.ui b/src/plugins/cvs/settingspage.ui index 6798485edb1530f0cd9e5f59d01d6a5e78c46354..efff37aadd889b0fb7b478797b2a5636f2d301b3 100644 --- a/src/plugins/cvs/settingspage.ui +++ b/src/plugins/cvs/settingspage.ui @@ -30,7 +30,7 @@ <string>When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit id). Otherwise, only the respective file will be displayed.</string> </property> <property name="text"> - <string>Describe by commit id</string> + <string>Describe all files matching commit id:</string> </property> </widget> </item> diff --git a/src/plugins/debugger/breakwindow.cpp b/src/plugins/debugger/breakwindow.cpp index 92d342983ac82e946ea7f3d3afc97c5dfc9ca9d5..543a9e3bd6733500ee620456ddd365675f84cbcc 100644 --- a/src/plugins/debugger/breakwindow.cpp +++ b/src/plugins/debugger/breakwindow.cpp @@ -136,10 +136,10 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev) const int rowCount = itemModel->rowCount(); - QAction *deleteAction = new QAction(tr("Delete breakpoint", 0, si.size()), &menu); + QAction *deleteAction = new QAction(tr("Delete breakpoint"), &menu); deleteAction->setEnabled(si.size() > 0); - QAction *deleteAllAction = new QAction(tr("Delete all breakpoints", 0, si.size()), &menu); + QAction *deleteAllAction = new QAction(tr("Delete all breakpoints"), &menu); deleteAllAction->setEnabled(si.size() > 0); // Delete by file: Find indexes of breakpoints of the same file @@ -168,7 +168,7 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev) alwaysAdjustAction->setCheckable(true); alwaysAdjustAction->setChecked(m_alwaysResizeColumnsToContents); - QAction *editConditionAction = new QAction(tr("Edit condition...", 0, si.size()), &menu); + QAction *editConditionAction = new QAction(tr("Edit condition..."), &menu); editConditionAction->setEnabled(si.size() > 0); QAction *synchronizeAction = new QAction(tr("Synchronize breakpoints"), &menu); diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index b3ca55f0dc17e9fe36133f9e37038103f8b8fd48..a2adb1baa6e684f4f4a0dbf336eacc98a47dc166 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -1525,10 +1525,11 @@ QString DebuggerManager::qtDumperLibraryName() const QStringList DebuggerManager::qtDumperLibraryLocations() const { - if (theDebuggerAction(UseCustomDebuggingHelperLocation)->value().toBool()) - return QStringList() << - ( theDebuggerAction(CustomDebuggingHelperLocation)->value().toString() - + tr(" (explicitly set in the Debugger Options)")); + if (theDebuggerAction(UseCustomDebuggingHelperLocation)->value().toBool()) { + const QString customLocation = theDebuggerAction(CustomDebuggingHelperLocation)->value().toString(); + const QString location = tr("%1 (explicitly set in the Debugger Options)").arg(customLocation); + return QStringList(location); + } return m_dumperLibLocations; } diff --git a/src/plugins/designer/cpp/cppsettingspagewidget.ui b/src/plugins/designer/cpp/cppsettingspagewidget.ui index 8a34601df91bb7b3097e3f98c59bfce4cf8a6d05..b06c43da415f7dc629cf9972b83161b57804771d 100644 --- a/src/plugins/designer/cpp/cppsettingspagewidget.ui +++ b/src/plugins/designer/cpp/cppsettingspagewidget.ui @@ -68,7 +68,7 @@ <item> <widget class="QCheckBox" name="includeQtModuleCheckBox"> <property name="text"> - <string>Include Qt module name</string> + <string>Use Qt module name in #include-directive</string> </property> </widget> </item> diff --git a/src/plugins/qt4projectmanager/qt-s60/qt-s60-todo.txt b/src/plugins/qt4projectmanager/qt-s60/qt-s60-todo.txt index 81636f56bd1e1a689a68bf1586da8b53e2d079fe..938360904369b01f1ed103413dbd482e44b282d5 100644 --- a/src/plugins/qt4projectmanager/qt-s60/qt-s60-todo.txt +++ b/src/plugins/qt4projectmanager/qt-s60/qt-s60-todo.txt @@ -26,7 +26,6 @@ * auto-create run configurations the first time s60 qt is selected. * Run on device - * Finish runner when application exits * passphrase for signing * time stamp of copied sisx is ridiculous * maybe don't copy the sisx all the time diff --git a/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri b/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri index 00895244cef6894158930d642499322b0007bef7..bfc53ae98e13587f8738480f9eb876d95a66ad53 100644 --- a/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri +++ b/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri @@ -8,14 +8,16 @@ SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60) $$PWD/winscwtoolchain.cpp \ $$PWD/gccetoolchain.cpp \ $$PWD/s60emulatorrunconfiguration.cpp \ - $$PWD/s60devicerunconfiguration.cpp + $$PWD/s60devicerunconfiguration.cpp \ + $$PWD/serialdevicelister.cpp HEADERS += $$PWD/s60devices.h \ $$PWD/s60devicespreferencepane.h \ $$PWD/s60manager.h \ $$PWD/winscwtoolchain.h \ $$PWD/gccetoolchain.h \ $$PWD/s60emulatorrunconfiguration.h \ - $$PWD/s60devicerunconfiguration.h + $$PWD/s60devicerunconfiguration.h \ + $$PWD/serialdevicelister.h FORMS += $$PWD/s60devicespreferencepane.ui OTHER_FILES += $$PWD/qt-s60-todo.txt diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp index 5c73ae0488db7b1fefeecb3fbdde597461a74bcc..71ef6338383373307270a4a2eb42c0239f587a46 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp @@ -34,6 +34,7 @@ #include "profilereader.h" #include "s60manager.h" #include "s60devices.h" +#include "serialdevicelister.h" #include <coreplugin/icore.h> #include <coreplugin/messagemanager.h> @@ -52,6 +53,7 @@ S60DeviceRunConfiguration::S60DeviceRunConfiguration(Project *project, const QSt : RunConfiguration(project), m_proFilePath(proFilePath), m_cachedTargetInformationValid(false), + m_serialPortName("COM5"), m_signingMode(SignSelf) { if (!m_proFilePath.isEmpty()) @@ -95,6 +97,7 @@ void S60DeviceRunConfiguration::save(PersistentSettingsWriter &writer) const writer.saveValue("SigningMode", (int)m_signingMode); writer.saveValue("CustomSignaturePath", m_customSignaturePath); writer.saveValue("CustomKeyPath", m_customKeyPath); + writer.saveValue("SerialPortName", m_serialPortName); RunConfiguration::save(writer); } @@ -106,6 +109,17 @@ void S60DeviceRunConfiguration::restore(const PersistentSettingsReader &reader) m_signingMode = (SigningMode)reader.restoreValue("SigningMode").toInt(); m_customSignaturePath = reader.restoreValue("CustomSignaturePath").toString(); m_customKeyPath = reader.restoreValue("CustomKeyPath").toString(); + m_serialPortName = reader.restoreValue("SerialPortName").toString().trimmed(); +} + +QString S60DeviceRunConfiguration::serialPortName() const +{ + return m_serialPortName; +} + +void S60DeviceRunConfiguration::setSerialPortName(const QString &name) +{ + m_serialPortName = name.trimmed(); } QString S60DeviceRunConfiguration::targetName() const @@ -216,7 +230,7 @@ void S60DeviceRunConfiguration::updateTarget() if (projectBuildConfiguration & QtVersion::DebugBuild) m_baseFileName += "_udeb"; else - m_baseFileName += "_rel"; + m_baseFileName += "_urel"; delete reader; m_cachedTargetInformationValid = true; @@ -251,6 +265,21 @@ S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget(S60DeviceRunCon m_sisxFileLabel = new QLabel(m_runConfiguration->basePackageFilePath() + ".sisx"); formLayout->addRow(tr("Install File:"), m_sisxFileLabel); + QString runConfigurationPortName = m_runConfiguration->serialPortName(); + QList<SerialDeviceLister::SerialDevice> serialDevices = SerialDeviceLister().serialDevices(); + m_serialPorts = new QComboBox; + for (int i = 0; i < serialDevices.size(); ++i) { + const SerialDeviceLister::SerialDevice &device = serialDevices.at(i); + m_serialPorts->addItem(device.friendlyName, device.portName); + if (device.portName == runConfigurationPortName) + m_serialPorts->setCurrentIndex(i); + } + QString selectedPortName = m_serialPorts->itemData(m_serialPorts->currentIndex()).toString(); + if (m_serialPorts->count() > 0 && runConfigurationPortName != selectedPortName) + m_runConfiguration->setSerialPortName(selectedPortName); + connect(m_serialPorts, SIGNAL(activated(int)), this, SLOT(setSerialPort(int))); + formLayout->addRow(tr("Device on Serial Port:"), m_serialPorts); + QWidget *signatureWidget = new QWidget(); QVBoxLayout *layout = new QVBoxLayout(); signatureWidget->setLayout(layout); @@ -312,6 +341,11 @@ void S60DeviceRunConfigurationWidget::updateTargetInformation() m_sisxFileLabel->setText(m_runConfiguration->basePackageFilePath() + ".sisx"); } +void S60DeviceRunConfigurationWidget::setSerialPort(int index) +{ + m_runConfiguration->setSerialPortName(m_serialPorts->itemData(index).toString()); +} + void S60DeviceRunConfigurationWidget::selfSignToggled(bool toggle) { if (toggle) @@ -411,7 +445,7 @@ RunControl* S60DeviceRunConfigurationRunner::run(QSharedPointer<RunConfiguration // ======== S60DeviceRunControl S60DeviceRunControl::S60DeviceRunControl(QSharedPointer<RunConfiguration> runConfiguration) - : RunControl(runConfiguration) + : RunControl(runConfiguration), m_adapter(0) { m_makesis = new QProcess(this); connect(m_makesis, SIGNAL(readyReadStandardError()), @@ -440,6 +474,7 @@ void S60DeviceRunControl::start() Qt4Project *project = qobject_cast<Qt4Project *>(rc->project()); + m_serialPortName = rc->serialPortName(); m_targetName = rc->targetName(); m_baseFileName = rc->basePackageFilePath(); m_workingDirectory = QFileInfo(m_baseFileName).absolutePath(); @@ -471,7 +506,8 @@ void S60DeviceRunControl::stop() { m_makesis->kill(); m_signsis->kill(); - //m_adapter->terminate(); + if (m_adapter) + m_adapter->terminate(); } bool S60DeviceRunControl::isRunning() const @@ -533,22 +569,54 @@ void S60DeviceRunControl::signsisProcessFinished() emit finished(); return; } - //TODO m_adapter = new trk::Adapter; connect(m_adapter, SIGNAL(finished()), this, SLOT(runFinished())); - //TODO com selection, sisx destination and file path user definable - m_adapter->setTrkServerName("COM5"); + connect(m_adapter, SIGNAL(copyingStarted()), this, SLOT(printCopyingNotice())); + connect(m_adapter, SIGNAL(installingStarted()), this, SLOT(printInstallingNotice())); + connect(m_adapter, SIGNAL(startingApplication()), this, SLOT(printStartingNotice())); + connect(m_adapter, SIGNAL(applicationRunning(uint)), this, SLOT(printRunNotice(uint))); + + //TODO sisx destination and file path user definable + m_adapter->setTrkServerName(m_serialPortName); const QString copySrc(m_baseFileName + ".sisx"); const QString copyDst = QString("C:\\Data\\%1.sisx").arg(QFileInfo(m_baseFileName).fileName()); const QString runFileName = QString("C:\\sys\\bin\\%1.exe").arg(m_targetName); m_adapter->setCopyFileName(copySrc, copyDst); m_adapter->setInstallFileName(copyDst); m_adapter->setFileName(runFileName); - m_adapter->startServer(); + if (!m_adapter->startServer()) { + delete m_adapter; + m_adapter = 0; + error(this, tr("Could not connect to phone on port %1. " + "Check if the phone is connected and if it runs the TRK application.").arg(m_serialPortName)); + emit finished(); + } +} + +void S60DeviceRunControl::printCopyingNotice() +{ + emit addToOutputWindow(this, tr("Copying install file to device...")); +} + +void S60DeviceRunControl::printInstallingNotice() +{ + emit addToOutputWindow(this, tr("Installing application...")); +} + +void S60DeviceRunControl::printStartingNotice() +{ + emit addToOutputWindow(this, tr("Starting...")); +} + +void S60DeviceRunControl::printRunNotice(uint pid) +{ + emit addToOutputWindow(this, tr("Application started with pid %1.").arg(pid)); } void S60DeviceRunControl::runFinished() { + m_adapter->deleteLater(); + m_adapter = 0; emit addToOutputWindow(this, tr("Finished.")); emit finished(); } @@ -567,4 +635,5 @@ void S60DeviceRunControl::processFailed(const QString &program, QProcess::Proces errorString = tr("Some error has occurred while running %1."); } error(this, errorString.arg(program)); + emit finished(); } diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h index c989637273486feaa63301c426fe97dd1210a8db..3e4d7572a085aa072e27c49d9009f39abff8cf82 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h @@ -38,6 +38,7 @@ #include <QtGui/QWidget> #include <QtGui/QLabel> #include <QtGui/QLineEdit> +#include <QtGui/QComboBox> namespace Qt4ProjectManager { namespace Internal { @@ -60,6 +61,8 @@ public: void save(ProjectExplorer::PersistentSettingsWriter &writer) const; void restore(const ProjectExplorer::PersistentSettingsReader &reader); + QString serialPortName() const; + void setSerialPortName(const QString &name); QString targetName() const; QString basePackageFilePath() const; SigningMode signingMode() const; @@ -82,6 +85,7 @@ private: QString m_targetName; QString m_baseFileName; bool m_cachedTargetInformationValid; + QString m_serialPortName; SigningMode m_signingMode; QString m_customSignaturePath; QString m_customKeyPath; @@ -97,6 +101,7 @@ public: private slots: void nameEdited(const QString &text); void updateTargetInformation(); + void setSerialPort(int index); void selfSignToggled(bool toggle); void customSignatureToggled(bool toggle); void signaturePathChanged(const QString &path); @@ -104,6 +109,7 @@ private slots: private: S60DeviceRunConfiguration *m_runConfiguration; + QComboBox *m_serialPorts; QLineEdit *m_nameLineEdit; QLabel *m_sisxFileLabel; }; @@ -149,11 +155,16 @@ private slots: void makesisProcessFinished(); void signsisProcessFailed(); void signsisProcessFinished(); + void printCopyingNotice(); + void printInstallingNotice(); + void printStartingNotice(); + void printRunNotice(uint pid); void runFinished(); private: void processFailed(const QString &program, QProcess::ProcessError errorCode); + QString m_serialPortName; QString m_targetName; QString m_baseFileName; QString m_workingDirectory; diff --git a/src/plugins/qt4projectmanager/qt-s60/serialdevicelister.cpp b/src/plugins/qt4projectmanager/qt-s60/serialdevicelister.cpp new file mode 100644 index 0000000000000000000000000000000000000000..948b7241e098ef0f90572fb90789cfdd99e6943b --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-s60/serialdevicelister.cpp @@ -0,0 +1,63 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** +**************************************************************************/ + +#include "serialdevicelister.h" + +#include <QtCore/QSettings> +#include <QtCore/QStringList> +#include <QtDebug> + +using namespace Qt4ProjectManager::Internal; + +namespace { + const char * const REGKEY_CURRENT_CONTROL_SET = "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet"; + const char * const USBSER = "Services/usbser/Enum"; +} + +SerialDeviceLister::SerialDeviceLister() +{ +} + +QList<SerialDeviceLister::SerialDevice> SerialDeviceLister::serialDevices() const +{ + QList<SerialDeviceLister::SerialDevice> devices; + QSettings registry(REGKEY_CURRENT_CONTROL_SET, QSettings::NativeFormat); + int count = registry.value(QString::fromLatin1("%1/Count").arg(USBSER)).toInt(); + for (int i = 0; i < count; ++i) { + QString driver = registry.value(QString::fromLatin1("%1/%2").arg(USBSER).arg(i)).toString(); + if (driver.contains("JAVACOMM")) { + driver.replace('\\', '/'); + SerialDeviceLister::SerialDevice device; + device.friendlyName = registry.value(QString::fromLatin1("Enum/%1/FriendlyName").arg(driver)).toString(); + device.portName = registry.value(QString::fromLatin1("Enum/%1/Device Parameters/PortName").arg(driver)).toString(); + devices.append(device); + } + } + return devices; +} diff --git a/src/plugins/qt4projectmanager/qt-s60/serialdevicelister.h b/src/plugins/qt4projectmanager/qt-s60/serialdevicelister.h new file mode 100644 index 0000000000000000000000000000000000000000..c314dd19758b4c4c26024010ef2229ea227ca7ca --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-s60/serialdevicelister.h @@ -0,0 +1,57 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** +**************************************************************************/ + +#ifndef SERIALDEVICELISTER_H +#define SERIALDEVICELISTER_H + +#include <QtCore/QObject> +#include <QtCore/QString> +#include <QtCore/QList> + +namespace Qt4ProjectManager { +namespace Internal { + +class SerialDeviceLister : public QObject +{ + Q_OBJECT +public: + + struct SerialDevice { + QString portName; + QString friendlyName; + }; + + SerialDeviceLister(); + QList<SerialDevice> serialDevices() const; +}; + +} // Internal +} // Qt4ProjectManager + +#endif // SERIALDEVICELISTER_H diff --git a/tests/manual/trk/launcher.cpp b/tests/manual/trk/launcher.cpp index 201dda4dfc1081420d3811971e032a8cf50033dd..f1796da7075f13b84cbd5a1ff1546e31ef6080a6 100644 --- a/tests/manual/trk/launcher.cpp +++ b/tests/manual/trk/launcher.cpp @@ -40,10 +40,14 @@ BOOL WINAPI TryReadFile(HANDLE hFile, LPOVERLAPPED lpOverlapped) { COMSTAT comStat; - if(!ClearCommError(hFile, NULL, &comStat)){ + if (!ClearCommError(hFile, NULL, &comStat)){ qDebug() << "ClearCommError() failed"; return FALSE; } + if (comStat.cbInQue == 0) { + *lpNumberOfBytesRead = 0; + return FALSE; + } return ReadFile(hFile, lpBuffer, qMin(comStat.cbInQue, nNumberOfBytesToRead), @@ -66,7 +70,6 @@ Adapter::Adapter() #endif m_trkWriteToken = 0; m_trkWriteBusy = false; - startTimer(100); } Adapter::~Adapter() @@ -85,10 +88,10 @@ Adapter::~Adapter() bool Adapter::startServer() { if (!openTrkPort(m_trkServerName)) { - qDebug("Unable to connect to TRK server"); + logMessage("Unable to connect to TRK server"); return false; } - qDebug("Connecting"); + m_timerId = startTimer(100); sendTrkInitialPing(); sendTrkMessage(TrkConnect); // Connect sendTrkMessage(TrkSupported, CB(handleSupportMask)); @@ -105,7 +108,6 @@ void Adapter::installAndRun() { if (!m_installFileName.isEmpty()) { installRemotePackageSilently(m_installFileName); - startInferiorIfNeeded(); } else { startInferiorIfNeeded(); } @@ -197,6 +199,14 @@ void Adapter::waitForTrkFinished(const TrkResult &result) sendTrkMessage(TrkPing, CB(handleWaitForFinished)); } +void Adapter::terminate() +{ + QByteArray ba; + appendShort(&ba, 0x0000, TargetByteOrder); + appendInt(&ba, m_session.pid, TargetByteOrder); + sendTrkMessage(TrkDeleteItem, CB(waitForTrkFinished), ba); +} + void Adapter::sendTrkAck(byte token) { logMessage(QString("SENDING ACKNOWLEDGEMENT FOR TOKEN %1").arg(int(token))); @@ -262,6 +272,9 @@ void Adapter::tryTrkRead() if (isValidTrkResult(m_trkReadQueue)) break; } + if (charsRead == 0 && m_trkReadQueue.isEmpty()) { + return; + } #else // USE_NATIVE if (m_trkDevice->bytesAvailable() == 0 && m_trkReadQueue.isEmpty()) { return; @@ -462,10 +475,11 @@ void Adapter::handleCreateProcess(const TrkResult &result) m_session.tid = extractInt(data + 5); m_session.codeseg = extractInt(data + 9); m_session.dataseg = extractInt(data + 13); - qDebug() << " READ PID: " << m_session.pid; - qDebug() << " READ TID: " << m_session.tid; - qDebug() << " READ CODE: " << m_session.codeseg; - qDebug() << " READ DATA: " << m_session.dataseg; + logMessage(QString(" READ PID: %1").arg(m_session.pid)); + logMessage(QString(" READ TID: %1").arg(m_session.tid)); + logMessage(QString(" READ CODE: %1").arg(m_session.codeseg)); + logMessage(QString(" READ DATA: %1").arg(m_session.dataseg)); + emit applicationRunning(m_session.pid); QByteArray ba; appendInt(&ba, m_session.pid); appendInt(&ba, m_session.tid); @@ -475,6 +489,7 @@ void Adapter::handleCreateProcess(const TrkResult &result) void Adapter::handleWaitForFinished(const TrkResult &result) { logMessage(" FINISHED: " + stringFromArray(result.data)); + killTimer(m_timerId); emit finished(); } @@ -548,7 +563,7 @@ void Adapter::cleanUp() void Adapter::copyFileToRemote() { - qDebug("Copying file"); + emit copyingStarted(); QByteArray ba; appendByte(&ba, 0x10); appendString(&ba, m_copyDstFileName.toLocal8Bit(), TargetByteOrder, false); @@ -557,18 +572,23 @@ void Adapter::copyFileToRemote() void Adapter::installRemotePackageSilently(const QString &fileName) { - qDebug("Installing file"); + emit installingStarted(); QByteArray ba; appendByte(&ba, 'C'); appendString(&ba, fileName.toLocal8Bit(), TargetByteOrder, false); - sendTrkMessage(TrkInstallFile, 0, ba); + sendTrkMessage(TrkInstallFile, CB(handleInstallPackageFinished), ba); +} + +void Adapter::handleInstallPackageFinished(const TrkResult &) +{ + startInferiorIfNeeded(); } void Adapter::startInferiorIfNeeded() { - qDebug("Starting"); + emit startingApplication(); if (m_session.pid != 0) { - qDebug() << "Process already 'started'"; + logMessage("Process already 'started'"); return; } // It's not started yet diff --git a/tests/manual/trk/launcher.h b/tests/manual/trk/launcher.h index 656d6514186e620439e36d5bbc913c4c7dea1b5f..42b46a7ad63adafb0fbe4753c9a449451a8cc2e2 100644 --- a/tests/manual/trk/launcher.h +++ b/tests/manual/trk/launcher.h @@ -62,8 +62,15 @@ public: bool startServer(); signals: + void copyingStarted(); + void installingStarted(); + void startingApplication(); + void applicationRunning(uint pid); void finished(); +public slots: + void terminate(); + private: // // TRK @@ -103,6 +110,7 @@ private: void handleFileCreation(const TrkResult &result); void handleFileCreated(const TrkResult &result); + void handleInstallPackageFinished(const TrkResult &result); void handleCpuType(const TrkResult &result); void handleCreateProcess(const TrkResult &result); void handleWaitForFinished(const TrkResult &result); @@ -137,6 +145,7 @@ private: // Debuggee state Session m_session; // global-ish data (process id, target information) + int m_timerId; QString m_fileName; QString m_copySrcFileName; QString m_copyDstFileName;