diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2009-12-22 16:14:59 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@sosco.com> | 2010-01-04 14:49:52 (GMT) |
commit | 0e94349de0b602f1b6af747b66ef03b22133cc3a (patch) | |
tree | bddd755f649be409c2af2fda9f4ffa8f32d18afc /tools/runonphone/trk | |
parent | 44f7b73940c67b8e81f52dfc6370453ff07d3aa2 (diff) | |
download | Qt-0e94349de0b602f1b6af747b66ef03b22133cc3a.zip Qt-0e94349de0b602f1b6af747b66ef03b22133cc3a.tar.gz Qt-0e94349de0b602f1b6af747b66ef03b22133cc3a.tar.bz2 |
Deal with test cases that crash or hang
Added an optional timeout to runonphone - the application will be killed
after this time. Used when autotesting unattended, as some tests can hang.
Handled the just in time debug halting the application when it is about
to crash, by terminating the application. In future, we could capture a
call stack or something here.
Also added quiet/verbose options to control the amount of output from
runonphone.
Reviewed-by: Janne Koskinen
Diffstat (limited to 'tools/runonphone/trk')
-rw-r--r-- | tools/runonphone/trk/launcher.cpp | 20 | ||||
-rw-r--r-- | tools/runonphone/trk/launcher.h | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tools/runonphone/trk/launcher.cpp b/tools/runonphone/trk/launcher.cpp index 90ad602..a5d173a 100644 --- a/tools/runonphone/trk/launcher.cpp +++ b/tools/runonphone/trk/launcher.cpp @@ -317,6 +317,18 @@ void Launcher::handleResult(const TrkResult &result) case TrkNotifyStopped: { // Notified Stopped logMessage(prefix + "NOTE: STOPPED " + str); // 90 01 78 6a 40 40 00 00 07 23 00 00 07 24 00 00 + QString reason; + if (result.data.size() >= 14) { + uint pc = extractInt(result.data.mid(0,4).constData()); + uint pid = extractInt(result.data.mid(4,4).constData()); + uint tid = extractInt(result.data.mid(8,4).constData()); + ushort len = extractShort(result.data.mid(12,2).constData()); + if(len > 0) + reason = result.data.mid(14, len); + emit(stopped(pc, pid, tid, reason)); + } else { + emit(stopped(0, 0, 0, reason)); + } //const char *data = result.data.data(); // uint addr = extractInt(data); //code address: 4 bytes; code base address for the library // uint pid = extractInt(data + 4); // ProcessID: 4 bytes; @@ -692,4 +704,12 @@ void Launcher::startInferiorIfNeeded() } d->m_device->sendTrkMessage(TrkCreateItem, TrkCallback(this, &Launcher::handleCreateProcess), ba); // Create Item } + +void Launcher::resume(uint pid, uint tid) +{ + QByteArray ba; + appendInt(&ba, pid, BigEndian); + appendInt(&ba, tid, BigEndian); + d->m_device->sendTrkMessage(TrkContinue, TrkCallback(), ba, "CONTINUE"); +} } // namespace trk diff --git a/tools/runonphone/trk/launcher.h b/tools/runonphone/trk/launcher.h index 29ee967..3a0c3ef 100644 --- a/tools/runonphone/trk/launcher.h +++ b/tools/runonphone/trk/launcher.h @@ -125,9 +125,11 @@ signals: void applicationOutputReceived(const QString &output); void copyProgress(int percent); void stateChanged(int); + void stopped(uint pc, uint pid, uint tid, const QString& reason); public slots: void terminate(); + void resume(uint pid, uint tid); private slots: void handleResult(const trk::TrkResult &data); |