summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2010-01-21 15:46:33 +0100
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2010-01-21 15:46:33 +0100
commitc516f350b21569611ffa034764808586c4e5f4e4 (patch)
treed66d62c0f58d97d98f3cac6d835c4cd040497445
parent53c672fb9853fef5a00285213084f02a4253e5f3 (diff)
downloadqt-creator-c516f350b21569611ffa034764808586c4e5f4e4.tar.gz
S60: Handle TrkNotifyStopped (crash) when running.
Extract error message string from Trk, print proper message when application crashes in run mode and terminate launcher. Use same message in Debugger for consistency. Reviewed-by: Robert Loehning <robert.loehning@nokia.com>Reviewed-by: John Doe
-rw-r--r--src/plugins/debugger/gdb/trkgdbadapter.cpp19
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp8
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h1
-rw-r--r--tests/manual/trklauncher/main.cpp2
4 files changed, 22 insertions, 8 deletions
diff --git a/src/plugins/debugger/gdb/trkgdbadapter.cpp b/src/plugins/debugger/gdb/trkgdbadapter.cpp
index 2093d1b2b4..8bb968c229 100644
--- a/src/plugins/debugger/gdb/trkgdbadapter.cpp
+++ b/src/plugins/debugger/gdb/trkgdbadapter.cpp
@@ -28,6 +28,7 @@
**************************************************************************/
#include "trkgdbadapter.h"
+#include "launcher.h"
#include "trkoptions.h"
#include "trkoptionspage.h"
#include "s60debuggerbluetoothstarter.h"
@@ -1054,16 +1055,18 @@ void TrkGdbAdapter::handleTrkResult(const TrkResult &result)
logMessage(logMsg);
break;
}
- case 0x90: { // Notified Stopped
+ case TrkNotifyStopped: { // Notified Stopped
// 90 01 78 6a 40 40 00 00 07 23 00 00 07 24 00 00
debugMessage(_("RESET SNAPSHOT (NOTIFY STOPPED)"));
m_snapshot.reset();
- const char *data = result.data.data();
- const uint addr = extractInt(data);
- const uint pid = extractInt(data + 4);
- const uint tid = extractInt(data + 8);
- logMessage(prefix + _("NOTE: PID %1/TID %2 "
- "STOPPED at 0x%3").arg(pid).arg(tid).arg(addr, 0, 16));
+ QString reason;
+ uint addr;
+ uint pid;
+ uint tid;
+ trk::Launcher::parseNotifyStopped(result.data, &pid, &tid, &addr, &reason);
+ const QString msg = trk::Launcher::msgStopped(pid, tid, addr, reason);
+ logMessage(prefix + msg);
+ m_engine->manager()->showDebuggerOutput(LogMisc, msg);
sendTrkAck(result.token);
if (addr) {
// Todo: Do not send off GdbMessages if a synced gdb
@@ -1082,7 +1085,7 @@ void TrkGdbAdapter::handleTrkResult(const TrkResult &result)
trkReadRegistersMessage());
break;
}
- case 0x91: { // Notify Exception (obsolete)
+ case TrkNotifyException: { // Notify Exception (obsolete)
debugMessage(_("RESET SNAPSHOT (NOTIFY EXCEPTION)"));
m_snapshot.reset();
logMessage(prefix + "NOTE: EXCEPTION " + str);
diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
index 52756861a6..075a55d637 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
+++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
@@ -669,6 +669,8 @@ void S60DeviceRunControlBase::startDeployment()
connect(m_launcher, SIGNAL(installingFinished()), this, SLOT(printInstallingFinished()));
connect(m_launcher, SIGNAL(copyProgress(int)), this, SLOT(printCopyProgress(int)));
connect(m_launcher, SIGNAL(stateChanged(int)), this, SLOT(slotLauncherStateChanged(int)));
+ connect(m_launcher, SIGNAL(processStopped(uint,uint,uint,QString)),
+ this, SLOT(processStopped(uint,uint,uint,QString)));
//TODO sisx destination and file path user definable
m_launcher->setTrkServerName(m_serialPortName);
@@ -775,6 +777,12 @@ void S60DeviceRunControlBase::reportDeployFinished()
}
}
+void S60DeviceRunControlBase::processStopped(uint pc, uint pid, uint tid, const QString& reason)
+{
+ emit addToOutputWindow(this, trk::Launcher::msgStopped(pid, tid, pc, reason));
+ m_launcher->terminate();
+}
+
QMessageBox *S60DeviceRunControlBase::createTrkWaitingMessageBox(const QString &port, QWidget *parent)
{
const QString title = QCoreApplication::translate("Qt4ProjectManager::Internal::S60DeviceRunControlBase",
diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h
index 1dd9228488..26b7133862 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h
+++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h
@@ -169,6 +169,7 @@ protected slots:
void printApplicationOutput(const QString &output);
private slots:
+ void processStopped(uint pc, uint pid, uint tid, const QString& reason);
void readStandardError();
void readStandardOutput();
void makesisProcessFailed();
diff --git a/tests/manual/trklauncher/main.cpp b/tests/manual/trklauncher/main.cpp
index f35c49b931..50a15f45f2 100644
--- a/tests/manual/trklauncher/main.cpp
+++ b/tests/manual/trklauncher/main.cpp
@@ -147,6 +147,8 @@ int main(int argc, char *argv[])
return 1;
}
QObject::connect(launcher.data(), SIGNAL(finished()), &app, SLOT(quit()));
+ QObject::connect(launcher.data(), SIGNAL(processStopped(uint,uint,uint,QString)),
+ launcher.data(), SLOT(terminate()));
// BLuetooth: Open with prompt
QString errorMessage;
if (bluetooth && !trk::ConsoleBluetoothStarter::startBluetooth(launcher->trkDevice(),