Changeset 651 for trunk/tools/runonphone/trk
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
-
. (modified) (1 prop)
-
tools/runonphone/trk/bluetoothlistener.cpp (modified) (1 diff)
-
tools/runonphone/trk/bluetoothlistener.h (modified) (1 diff)
-
tools/runonphone/trk/bluetoothlistener_gui.cpp (modified) (1 diff)
-
tools/runonphone/trk/bluetoothlistener_gui.h (modified) (1 diff)
-
tools/runonphone/trk/callback.h (modified) (1 diff)
-
tools/runonphone/trk/communicationstarter.cpp (modified) (1 diff)
-
tools/runonphone/trk/communicationstarter.h (modified) (1 diff)
-
tools/runonphone/trk/launcher.cpp (modified) (7 diffs)
-
tools/runonphone/trk/launcher.h (modified) (4 diffs)
-
tools/runonphone/trk/trkdevice.cpp (modified) (15 diffs)
-
tools/runonphone/trk/trkdevice.h (modified) (1 diff)
-
tools/runonphone/trk/trkutils.cpp (modified) (1 diff)
-
tools/runonphone/trk/trkutils.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/tools/runonphone/trk/bluetoothlistener.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/tools/runonphone/trk/bluetoothlistener.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/tools/runonphone/trk/bluetoothlistener_gui.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/tools/runonphone/trk/bluetoothlistener_gui.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/tools/runonphone/trk/callback.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/tools/runonphone/trk/communicationstarter.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/tools/runonphone/trk/communicationstarter.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/tools/runonphone/trk/launcher.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 77 77 CopyState m_copyState; 78 78 QString m_fileName; 79 QString m_commandLineArgs;79 QString m_commandLineArgs; 80 80 QString m_installFileName; 81 81 int m_verbose; … … 160 160 } 161 161 162 void Launcher::setCommandLineArgs(const QString &args)162 void Launcher::setCommandLineArgs(const QString &args) 163 163 { 164 164 d->m_commandLineArgs = args; … … 190 190 errorMessage->clear(); 191 191 if (d->m_verbose) { 192 const QString msg = QString::fromLatin1("Port=%1 Executable=%2 Package=%3 Remote Package=%4 Install file=%5") 193 .arg(d->m_trkServerName, d->m_fileName, d->m_copyState.sourceFileName, d->m_copyState.destinationFileName, d->m_installFileName); 192 const QString msg = QString::fromLatin1("Port=%1 Executable=%2 Arguments=%3 Package=%4 Remote Package=%5 Install file=%6") 193 .arg(d->m_trkServerName, d->m_fileName, 194 d->m_commandLineArgs.join(QString(QLatin1Char(' '))), 195 d->m_copyState.sourceFileName, d->m_copyState.destinationFileName, d->m_installFileName); 194 196 logMessage(msg); 195 197 } … … 297 299 } 298 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 299 329 void Launcher::handleResult(const TrkResult &result) 300 330 { … … 316 346 } 317 347 case TrkNotifyStopped: { // Notified Stopped 318 logMessage(prefix + "NOTE: STOPPED " + str);319 // 90 01 78 6a 40 40 00 00 07 23 00 00 07 24 00 00320 348 QString reason; 321 if (result.data.size() >= 14) { 322 uint pc = extractInt(result.data.mid(0,4).constData()); 323 uint pid = extractInt(result.data.mid(4,4).constData()); 324 uint tid = extractInt(result.data.mid(8,4).constData()); 325 ushort len = extractShort(result.data.mid(12,2).constData()); 326 if(len > 0) 327 reason = result.data.mid(14, len); 328 emit(stopped(pc, pid, tid, reason)); 329 } else { 330 emit(stopped(0, 0, 0, reason)); 331 } 332 //const char *data = result.data.data(); 333 // uint addr = extractInt(data); //code address: 4 bytes; code base address for the library 334 // uint pid = extractInt(data + 4); // ProcessID: 4 bytes; 335 // uint tid = extractInt(data + 8); // ThreadID: 4 bytes 336 //logMessage(prefix << " ADDR: " << addr << " PID: " << pid << " TID: " << tid); 349 uint pc; 350 uint pid; 351 uint tid; 352 parseNotifyStopped(result.data, &pid, &tid, &pc, &reason); 353 logMessage(prefix + msgStopped(pid, tid, pc, reason)); 354 emit(processStopped(pc, pid, tid, reason)); 337 355 d->m_device->sendTrkAck(result.token); 338 356 break; … … 682 700 } 683 701 684 void Launcher::startInferiorIfNeeded() 685 { 686 emit startingApplication(); 687 if (d->m_session.pid != 0) { 688 logMessage("Process already 'started'"); 689 return; 690 } 702 QByteArray Launcher::startProcessMessage(const QString &executable, 703 const QStringList &arguments) 704 { 691 705 // It's not started yet 692 706 QByteArray ba; 693 707 appendShort(&ba, 0, TargetByteOrder); // create new process 694 708 appendByte(&ba, 0); // options - currently unused 695 696 if(d->m_commandLineArgs.isEmpty()) { 697 appendString(&ba, d->m_fileName.toLocal8Bit(), TargetByteOrder); 698 } else { 699 QByteArray ba2; 700 ba2.append(d->m_fileName.toLocal8Bit()); 701 ba2.append('\0'); 702 ba2.append(d->m_commandLineArgs.toLocal8Bit()); 703 appendString(&ba, ba2, TargetByteOrder); 704 } 705 d->m_device->sendTrkMessage(TrkCreateItem, TrkCallback(this, &Launcher::handleCreateProcess), ba); // Create Item 706 } 707 708 void Launcher::resume(uint pid, uint tid) 709 if(arguments.isEmpty()) { 710 appendString(&ba, executable.toLocal8Bit(), TargetByteOrder); 711 return ba; 712 } 713 // Append full command line as one string (leading length information). 714 QByteArray commandLineBa; 715 commandLineBa.append(executable.toLocal8Bit()); 716 commandLineBa.append('\0'); 717 commandLineBa.append(arguments.join(QString(QLatin1Char(' '))).toLocal8Bit()); 718 appendString(&ba, commandLineBa, TargetByteOrder); 719 return ba; 720 } 721 722 void Launcher::startInferiorIfNeeded() 723 { 724 emit startingApplication(); 725 if (d->m_session.pid != 0) { 726 logMessage("Process already 'started'"); 727 return; 728 } 729 d->m_device->sendTrkMessage(TrkCreateItem, TrkCallback(this, &Launcher::handleCreateProcess), 730 startProcessMessage(d->m_fileName, d->m_commandLineArgs)); // Create Item 731 } 732 733 void Launcher::resumeProcess(uint pid, uint tid) 709 734 { 710 735 QByteArray ba; -
trunk/tools/runonphone/trk/launcher.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 96 96 void setCopyFileName(const QString &srcName, const QString &dstName); 97 97 void setInstallFileName(const QString &name); 98 void setCommandLineArgs(const QString &args);98 void setCommandLineArgs(const QString &args); 99 99 bool startServer(QString *errorMessage); 100 100 void setVerbose(int v); … … 109 109 // becomes valid after successful execution of ActionPingOnly 110 110 QString deviceDescription(unsigned verbose = 0u) const; 111 112 113 114 115 116 117 118 119 111 120 112 121 signals: … … 126 135 void copyProgress(int percent); 127 136 void stateChanged(int); 128 void stopped(uint pc, uint pid, uint tid, const QString& reason);137 void topped(uint pc, uint pid, uint tid, const QString& reason); 129 138 130 139 public slots: 131 140 void terminate(); 132 void resume (uint pid, uint tid);141 void resume(uint pid, uint tid); 133 142 134 143 private slots: -
trunk/tools/runonphone/trk/trkdevice.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 100 100 #endif 101 101 102 103 102 104 namespace trk { 103 105 … … 127 129 callback(cb) 128 130 { 131 132 133 134 135 136 129 137 } 130 138 … … 205 213 if (m_trkWriteToken == 0) 206 214 ++m_trkWriteToken; 215 216 207 217 return m_trkWriteToken; 208 218 } … … 335 345 /////////////////////////////////////////////////////////////////////// 336 346 337 class WriterThread : public QThread { 347 class WriterThread : public QThread 348 { 338 349 Q_OBJECT 339 350 Q_DISABLE_COPY(WriterThread) … … 401 412 if (m_terminate) 402 413 return 1; 414 403 415 // Send off message 404 416 m_dataMutex.lock(); … … 406 418 const TrkWriteQueue::PendingMessageResult pr = m_queue.pendingMessage(&message); 407 419 m_dataMutex.unlock(); 420 408 421 switch (pr) { 409 422 case TrkWriteQueue::NoMessage: 410 423 break; 411 424 case TrkWriteQueue::PendingMessage: { 425 412 426 // Untested: try to re-send a few times 413 427 bool success = false; … … 429 443 case TrkWriteQueue::NoopMessageDequeued: 430 444 // Sync with thread that owns us via a blocking signal 445 446 431 447 emit internalNoopMessageDequeued(message); 432 448 break; … … 500 516 bool WriterThread::write(const QByteArray &data, QString *errorMessage) 501 517 { 518 519 502 520 QMutexLocker locker(&m_context->mutex); 503 521 #ifdef Q_OS_WIN … … 558 576 } 559 577 578 560 579 /////////////////////////////////////////////////////////////////////// 561 580 // … … 567 586 /////////////////////////////////////////////////////////////////////// 568 587 569 class ReaderThreadBase : public QThread { 588 class ReaderThreadBase : public QThread 589 { 570 590 Q_OBJECT 571 591 Q_DISABLE_COPY(ReaderThreadBase) … … 626 646 /////////////////////////////////////////////////////////////////////// 627 647 628 class WinReaderThread : public ReaderThreadBase { 648 class WinReaderThread : public ReaderThreadBase 649 { 629 650 Q_OBJECT 630 651 Q_DISABLE_COPY(WinReaderThread) … … 836 857 // Trigger select() by writing to the pipe 837 858 char c = 0; 838 write(m_terminatePipeFileDescriptors[1], &c, 1); 859 int written = write(m_terminatePipeFileDescriptors[1], &c, 1); 860 // FIXME: Use result. 839 861 wait(); 840 862 } … … 1022 1044 { 1023 1045 d->writerThread->slotHandleResult(result); 1046 1047 1024 1048 emit messageReceived(result); 1025 1049 if (!rawData.isEmpty()) … … 1058 1082 msg.token = token; 1059 1083 msg.data.append('\0'); 1084 1085 1060 1086 return d->writerThread->trkWriteRawMessage(msg); 1061 1087 // 01 90 00 07 7e 80 01 00 7d 5e 7e -
trunk/tools/runonphone/trk/trkdevice.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/tools/runonphone/trk/trkutils.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) -
trunk/tools/runonphone/trk/trkutils.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 120 120 }; 121 121 122 struct TrkAppVersion { 122 struct TrkAppVersion 123 { 123 124 TrkAppVersion(); 124 125 void reset(); … … 153 154 typedef QList<Library> Libraries; 154 155 Libraries libraries; 156 157 158 159 155 160 156 161 // Gdb request
Note:
See TracChangeset
for help on using the changeset viewer.
