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>
This commit is contained in:
Friedemann Kleint
2010-01-21 15:27:05 +01:00
parent 9ac451eaba
commit 607e545218
4 changed files with 22 additions and 8 deletions

View File

@@ -28,6 +28,7 @@
**************************************************************************/
#include "trkgdbadapter.h"
#include "launcher.h"
#include "trkoptions.h"
#include "trkoptionspage.h"
#include "s60debuggerbluetoothstarter.h"
@@ -991,16 +992,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
@@ -1019,7 +1022,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);