summaryrefslogtreecommitdiffstats
path: root/tools/runonphone/trk
diff options
context:
space:
mode:
Diffstat (limited to 'tools/runonphone/trk')
-rw-r--r--tools/runonphone/trk/launcher.cpp20
-rw-r--r--tools/runonphone/trk/launcher.h2
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);