aboutsummaryrefslogtreecommitdiff
path: root/automoc/kde4automoc.cpp
diff options
context:
space:
mode:
authorDirk Mueller <mueller@kde.org>2007-08-21 14:14:48 +0000
committerDirk Mueller <mueller@kde.org>2007-08-21 14:14:48 +0000
commit6a9cb9ee8cb8f6d47dc06d9efb0a74be439210d0 (patch)
treef7ae672bfd6ed77e16bf323ec945e6fd55cade96 /automoc/kde4automoc.cpp
parent2da6dc51b6d685534d11147913bebc36f48af1cf (diff)
downloadextra-cmake-modules-6a9cb9ee8cb8f6d47dc06d9efb0a74be439210d0.tar.gz
extra-cmake-modules-6a9cb9ee8cb8f6d47dc06d9efb0a74be439210d0.tar.bz2
add some debug output to be able to track the
magic qprocess-timed-out bug better. svn path=/trunk/KDE/kdelibs/; revision=702914
Diffstat (limited to 'automoc/kde4automoc.cpp')
-rw-r--r--automoc/kde4automoc.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/automoc/kde4automoc.cpp b/automoc/kde4automoc.cpp
index bc92d9f7..b3d8053b 100644
--- a/automoc/kde4automoc.cpp
+++ b/automoc/kde4automoc.cpp
@@ -242,6 +242,7 @@ bool AutoMoc::run()
if (failed) {
// if any moc process failed we don't want to touch the _automoc.cpp file so that
// kde4automoc is rerun until the issue is fixed
+ cerr << "returning failed.."<< endl;
return false;
}
outStream.flush();
@@ -258,21 +259,17 @@ void AutoMoc::waitForProcesses()
{
while (!processes.isEmpty()) {
Process proc = processes.dequeue();
-
+
bool result = proc.qproc->waitForFinished();
//ignore errors from the cmake echo process
if (!proc.mocFilePath.isEmpty()) {
- if (!result) {
- cerr << "kde4automoc: process failed: " << proc.qproc->errorString() << endl;
- failed = true;
- if (!proc.mocFilePath.isEmpty()) {
- QFile::remove(proc.mocFilePath);
- }
- } else if (proc.qproc->exitCode() != 0) {
+ if (!result || proc.qproc->exitCode()) {
+ cerr << "kde4automoc: process for " << proc.mocFilePath
+ << " failed: " << proc.qproc->errorString() << endl;
+ cerr << "pid to wait for: " << proc.qproc->pid() << endl;
+ system("/bin/ps ux");
failed = true;
- if (!proc.mocFilePath.isEmpty()) {
- QFile::remove(proc.mocFilePath);
- }
+ QFile::remove(proc.mocFilePath);
}
}
delete proc.qproc;
@@ -301,7 +298,13 @@ void AutoMoc::generateMoc(const QString &sourceFile, const QString &mocFileName)
args << "-o" << mocFilePath << sourceFile;
//qDebug() << "executing: " << mocExe << args;
mocProc->start(mocExe, args, QIODevice::NotOpen);
- mocProc->waitForStarted();
- processes.enqueue(Process(mocProc, mocFilePath));
+ if (mocProc->waitForStarted())
+ processes.enqueue(Process(mocProc, mocFilePath));
+ else {
+ cerr << "kde4automoc: process for " << mocFilePath << "failed to start: "
+ << mocProc->errorString() << endl;
+ failed = true;
+ delete mocProc;
+ }
}
}