Changeset 699


Ignore:
Timestamp:
Mar 18, 2010, 3:42:18 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

corelib: QProcess: Simplified debug output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/corelib/io/qprocess_os2.cpp

    r690 r699  
    4343
    4444//#define QPROCESS_DEBUG
    45 #include "qdebug.h"
    4645
    4746#if defined(__INNOTEK_LIBC__)
     
    5251
    5352#if defined QPROCESS_DEBUG
     53
    5454#include "qstring.h"
    5555#include <ctype.h>
     
    8686    return out;
    8787}
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
     100
     101
     102
    88103QT_END_NAMESPACE
     104
     105
     106
     107
    89108#endif
    90109
     
    246265USHORT QProcessManager::addProcess(QProcess *process)
    247266{
    248 #if defined (QPROCESS_DEBUG)
    249     qDebug("QProcessManager::addProcess(%p)", process);
    250 #endif
     267    DEBUG(("QProcessManager::addProcess(%p)", process));
    251268
    252269    QMutexLocker locker(&mutex);
     
    317334    QProcess *process = instance->processes[procKey];
    318335
    319 #if defined (QPROCESS_DEBUG)
    320     qDebug("QProcessManager::removeProcess(%p)", process);
    321 #endif
     336    DEBUG(("QProcessManager::removeProcess(%p)", process));
    322337
    323338    // to guarantee that the given procKey may be reused, we must close all
     
    339354    : refcnt(0), finish(false), eventSem(NULLHANDLE), sa_old_sigchld_handler(0)
    340355{
    341 #if defined (QPROCESS_DEBUG)
    342     qDebug() << "QProcessManager::QProcessManager()";
    343 #endif
     356    DEBUG(() << "QProcessManager::QProcessManager()");
    344357
    345358    APIRET rc = DosCreateEventSem(NULL, &eventSem,
     
    354367QProcessManager::~QProcessManager()
    355368{
    356 #if defined (QPROCESS_DEBUG)
    357     qDebug() << "QProcessManager::~QProcessManager()";
    358 #endif
     369    DEBUG(() << "QProcessManager::~QProcessManager()");
    359370
    360371    Q_ASSERT(!refcnt);
     
    393404void QProcessManager::run()
    394405{
    395 #if defined (QPROCESS_DEBUG)
    396     qDebug() << "QProcessManager::run() BEGIN";
    397 #endif
     406    DEBUG(() << "QProcessManager::run() BEGIN");
    398407
    399408    // Note: the rationale behind using a worker thread so far is that
     
    419428
    420429        if (instance->deathFlag.testAndSetRelaxed(1, 0)) {
    421 #if defined (QPROCESS_DEBUG)
    422             qDebug() << "QProcessManager::run(): child death signaled";
    423 #endif
     430            DEBUG(() << "QProcessManager::run(): child death signaled");
    424431            foreach (QProcess *proc, processes) {
    425432                QProcessPrivate::WaitMode mode = (QProcessPrivate::WaitMode)
     
    442449            continue;
    443450
    444 #if defined (QPROCESS_DEBUG)
    445         qDebug() << "QProcessManager::run(): checking pipes";
    446 #endif
     451        DEBUG(() << "QProcessManager::run(): checking pipes");
    447452
    448453        // make sure the state array is big enough. The best size for sz pipes
     
    477482            if (pass == 1 && status != NPSS_CLOSE)
    478483                continue;
    479 #if defined(QPROCESS_DEBUG)
    480             qDebug(" %d/%d: fStatus %u fFlag f%02X usKey %04hX usAvail %hu",
     484            DEBUG((" %d/%d: fStatus %u fFlag f%02X usKey %04hX usAvail %hu",
    481485                   pass, i, (uint) pipeStates[i].fStatus,
    482486                   (uint) pipeStates[i].fFlag, pipeStates[i].usKey,
    483                    pipeStates[i].usAvail);
    484 #endif
     487                   pipeStates[i].usAvail));
    485488            int procKey = toProcKey(pipeStates[i].usKey);
    486489            QProcessPrivate::PipeType type = toPipeType(pipeStates[i].usKey);
     
    488491            QProcess *proc = processes[procKey];
    489492            Q_ASSERT(proc);
    490 #if defined(QPROCESS_DEBUG)
    491             qDebug("  process %p", proc);
    492 #endif
     493            DEBUG(("  process %p", proc));
    493494            QProcessPrivate *d = proc->d_func();
    494495
     
    538539    ::free(pipeStates);
    539540
    540 #if defined (QPROCESS_DEBUG)
    541     qDebug() << "QProcessManager::run() END";
    542 #endif
     541    DEBUG(() << "QProcessManager::run() END");
    543542}
    544543
     
    830829    }
    831830
    832 #if defined(QPROCESS_DEBUG)
    833     qDebug("qt_startProcess: workdir is \"%s\"", qPrintable(QDir::currentPath()));
    834 #endif
     831    DEBUG(("qt_startProcess: workdir is \"%s\"", qPrintable(QDir::currentPath())));
    835832
    836833    // try to find the executable
     
    883880    }
    884881
    885 #if defined(QPROCESS_DEBUG)
    886     qDebug("qt_startProcess: found \"%s\" for \"%s\"",
     882    DEBUG(("qt_startProcess: found \"%s\" for \"%s\"",
    887883           qPrintable(QFile::decodeName(fullProgramName)),
    888            qPrintable(QFile::decodeName(programName)));
    889 #endif
     884           qPrintable(QFile::decodeName(programName))));
    890885
    891886    int pid = -1;
     
    910905            paths = path.split(QLatin1Char(';'), QString::SkipEmptyParts);
    911906            if (paths.contains(fullPath, Qt::CaseInsensitive)) {
    912 #if defined(QPROCESS_DEBUG)
    913                 qDebug("qt_startProcess: \"%s\" is already in BEGINLIBPATH",
    914                        qPrintable(fullPath));
    915 #endif
     907                DEBUG(("qt_startProcess: \"%s\" is already in BEGINLIBPATH",
     908                       qPrintable(fullPath)));
    916909            } else {
    917 #if defined(QPROCESS_DEBUG)
    918                 qDebug("qt_startProcess: prepending \"%s\" to BEGINLIBPATH",
    919                        qPrintable(fullPath));
    920 #endif
     910                DEBUG(("qt_startProcess: prepending \"%s\" to BEGINLIBPATH",
     911                       qPrintable(fullPath)));
    921912                prependedLibPath = true;
    922913                QByteArray newLibPath = libPathBuf;