summaryrefslogtreecommitdiffstats
path: root/tools/runonphone/main.cpp
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2010-07-08 11:49:16 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2010-07-08 12:08:21 (GMT)
commitae2dfea96819a7b145f083bf39a674df90239066 (patch)
tree66f153d538bfe87cf26acfed65b52898642d7075 /tools/runonphone/main.cpp
parent627d62c17b29cf5a99252aeff965b4f848d4d171 (diff)
downloadQt-ae2dfea96819a7b145f083bf39a674df90239066.zip
Qt-ae2dfea96819a7b145f083bf39a674df90239066.tar.gz
Qt-ae2dfea96819a7b145f083bf39a674df90239066.tar.bz2
Implement just in time debug feature for runonphone
When the test being run crashes, runonphone will now retrieve the registers and call stack for the crashing thread from the phone and save to a crash log (compatible with d_exc crash logs, so existing tools can be used to analyse the log) To disable just in time debug, use --nocrashlog on the command line To save the crash logs to a different location, use --crashlogpath <path> otherwise, they are saved to the working directory. To convert the crash logs into human readable form, use the crash analyser carbide plugin from symbian foundation; or another symbian tool that can process d_exc style logs. Reviewed-by: Thomas Zander
Diffstat (limited to 'tools/runonphone/main.cpp')
-rw-r--r--tools/runonphone/main.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/runonphone/main.cpp b/tools/runonphone/main.cpp
index 885d029..dc83044 100644
--- a/tools/runonphone/main.cpp
+++ b/tools/runonphone/main.cpp
@@ -62,6 +62,8 @@ void printUsage(QTextStream& outstream, QString exeName)
<< "-v, --verbose show debugging output" << endl
<< "-q, --quiet hide progress messages" << endl
<< "-d, --download <remote file> <local file> copy file from phone to PC after running test" << endl
+ << "--nocrashlog Don't capture call stack if test crashes" << endl
+ << "--crashlogpath <dir> Path to save crash logs (default=working dir)" << endl
<< endl
<< "USB COM ports can usually be autodetected, use -p or -f to force a specific port." << endl
<< "If using System TRK, it is possible to copy the program directly to sys/bin on the phone." << endl
@@ -85,6 +87,8 @@ int main(int argc, char *argv[])
QString downloadLocalFile;
int loglevel=1;
int timeout=0;
+ bool crashlog = true;
+ QString crashlogpath;
QListIterator<QString> it(args);
it.next(); //skip name of program
while (it.hasNext()) {
@@ -126,6 +130,12 @@ int main(int argc, char *argv[])
loglevel=2;
else if (arg == "--quiet" || arg == "-q")
loglevel=0;
+ else if (arg == "--nocrashlog")
+ crashlog = false;
+ else if (arg == "--crashlogpath") {
+ CHECK_PARAMETER_EXISTS
+ crashlogpath = it.next();
+ }
else
errstream << "unknown command line option " << arg << endl;
} else {
@@ -199,6 +209,8 @@ int main(int argc, char *argv[])
TrkSignalHandler handler;
handler.setLogLevel(loglevel);
+ handler.setCrashLogging(crashlog);
+ handler.setCrashLogPath(crashlogpath);
QObject::connect(launcher.data(), SIGNAL(copyingStarted()), &handler, SLOT(copyingStarted()));
QObject::connect(launcher.data(), SIGNAL(canNotConnect(const QString &)), &handler, SLOT(canNotConnect(const QString &)));
@@ -215,8 +227,12 @@ int main(int argc, char *argv[])
QObject::connect(launcher.data(), SIGNAL(copyProgress(int)), &handler, SLOT(copyProgress(int)));
QObject::connect(launcher.data(), SIGNAL(stateChanged(int)), &handler, SLOT(stateChanged(int)));
QObject::connect(launcher.data(), SIGNAL(processStopped(uint,uint,uint,QString)), &handler, SLOT(stopped(uint,uint,uint,QString)));
+ QObject::connect(launcher.data(), SIGNAL(libraryLoaded(trk::Library)), &handler, SLOT(libraryLoaded(trk::Library)));
+ QObject::connect(launcher.data(), SIGNAL(libraryUnloaded(trk::Library)), &handler, SLOT(libraryUnloaded(trk::Library)));
+ QObject::connect(launcher.data(), SIGNAL(registersAndCallStackReadComplete(const QList<uint> &,const QByteArray &)), &handler, SLOT(registersAndCallStackReadComplete(const QList<uint> &,const QByteArray &)));
QObject::connect(&handler, SIGNAL(resume(uint,uint)), launcher.data(), SLOT(resumeProcess(uint,uint)));
QObject::connect(&handler, SIGNAL(terminate()), launcher.data(), SLOT(terminate()));
+ QObject::connect(&handler, SIGNAL(getRegistersAndCallStack(uint,uint)), launcher.data(), SLOT(getRegistersAndCallStack(uint,uint)));
QObject::connect(launcher.data(), SIGNAL(finished()), &handler, SLOT(finished()));
QTimer timer;