Issue with go to error in makewidget

John Ratke jratke at comcast.net
Sun Jun 8 21:09:02 UTC 2003


All,

I was doing some testing and I noticed to go to error would only 
partially work for me.  The reason for this is that for one file, it did 
not identify the correct directory.  And the reason for the incorrect 
directory identification was that some stderr messages got processed 
before stdout messages.


Correct order (direct execution of gmake -k from the project directory):

[kde-devel at john helloworldtest]$ gmake -k
gmake  all-recursive
gmake[1]: Entering directory `/home/kde-devel/helloworldtest'
Making all in src
gmake[2]: Entering directory `/home/kde-devel/helloworldtest/src'
if gcc -DHAVE_CONFIG_H -I. -I/home/kde-devel/helloworldtest/src -I..   
-I/usr/local/BerkeleyDB.4.1/include  -g -O2 -MT helloworldtest.o -MD -MP 
-MF ".deps/helloworldtest.Tpo" \
  -c -o helloworldtest.o `test -f 'helloworldtest.c' || echo 
'/home/kde-devel/helloworldtest/src/'`helloworldtest.c; \
then mv ".deps/helloworldtest.Tpo" ".deps/helloworldtest.Po"; \
else rm -f ".deps/helloworldtest.Tpo"; exit 1; \
fi
helloworldtest.c: In function `main':
helloworldtest.c:25: `a' undeclared (first use in this function)
helloworldtest.c:25: (Each undeclared identifier is reported only once
helloworldtest.c:25: for each function it appears in.)
helloworldtest.c:25: `b' undeclared (first use in this function)
helloworldtest.c:25: `c' undeclared (first use in this function)
helloworldtest.c:35: `other_error' undeclared (first use in this function)
gmake[2]: *** [helloworldtest.o] Error 1
if gcc -DHAVE_CONFIG_H -I. -I/home/kde-devel/helloworldtest/src -I..   
-I/usr/local/BerkeleyDB.4.1/include  -g -O2 -MT 
bug_check_helloworldtest.o -MD -MP -MF 
".deps/bug_check_helloworldtest.Tpo" \
  -c -o bug_check_helloworldtest.o `test -f 'bug_check_helloworldtest.c' 
|| echo '/home/kde-devel/helloworldtest/src/'`bug_check_helloworldtest.c; \
then mv ".deps/bug_check_helloworldtest.Tpo" 
".deps/bug_check_helloworldtest.Po"; \
else rm -f ".deps/bug_check_helloworldtest.Tpo"; exit 1; \
fi
bug_check_helloworldtest.c: In function `bug_check_helloworldtest':
bug_check_helloworldtest.c:15: `no_problem' undeclared (first use in 
this function)
bug_check_helloworldtest.c:15: (Each undeclared identifier is reported 
only once
bug_check_helloworldtest.c:15: for each function it appears in.)
gmake[2]: *** [bug_check_helloworldtest.o] Error 1
if gcc -DHAVE_CONFIG_H -I. -I/home/kde-devel/helloworldtest/src -I..   
-I/usr/local/BerkeleyDB.4.1/include  -g -O2 -MT this_is_helloworldtest.o 
-MD -MP -MF ".deps/this_is_helloworldtest.Tpo" \
  -c -o this_is_helloworldtest.o `test -f 'this_is_helloworldtest.c' || 
echo '/home/kde-devel/helloworldtest/src/'`this_is_helloworldtest.c; \
then mv ".deps/this_is_helloworldtest.Tpo" 
".deps/this_is_helloworldtest.Po"; \
else rm -f ".deps/this_is_helloworldtest.Tpo"; exit 1; \
fi
this_is_helloworldtest.c: In function `this_is_helloworldtest':
this_is_helloworldtest.c:15: `asdfoasijdfjf' undeclared (first use in 
this function)
this_is_helloworldtest.c:15: (Each undeclared identifier is reported 
only once
this_is_helloworldtest.c:15: for each function it appears in.)
gmake[2]: *** [this_is_helloworldtest.o] Error 1
gmake[2]: Target `all' not remade because of errors.
gmake[2]: Leaving directory `/home/kde-devel/helloworldtest/src'
gmake[2]: Entering directory `/home/kde-devel/helloworldtest'
gmake[2]: Nothing to be done for `all-am'.
gmake[2]: Leaving directory `/home/kde-devel/helloworldtest'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/kde-devel/helloworldtest'
gmake: *** [all] Error 2


Incorrect order (execution of gmake -k from kdevelop):
(I added a kdDebug statments in insertStdoutLine and insertStderrLine)

kdevelop (output views): Stdout line: gmake  all-recursive
kdevelop (output views): Stdout line: gmake[1]: Entering directory 
`/home/kde-devel/helloworldtest'
kdevelop (output views): Stdout line: Making all in src
kdevelop (output views): Stdout line: gmake[2]: Entering directory 
`/home/kde-devel/helloworldtest/src'
kdevelop (output views): Stdout line: if gcc -DHAVE_CONFIG_H -I. 
-I/home/kde-devel/helloworldtest/src -I..   
-I/usr/local/BerkeleyDB.4.1/include  -g -O2 -MT helloworldtest.o -MD -MP 
-MF ".deps/helloworldtest.Tpo" \
kdevelop (output views): Stdout line:   -c -o helloworldtest.o `test -f 
'helloworldtest.c' || echo 
'/home/kde-devel/helloworldtest/src/'`helloworldtest.c; \
kdevelop (output views): Stdout line: then mv ".deps/helloworldtest.Tpo" 
".deps/helloworldtest.Po"; \
kdevelop (output views): Stdout line: else rm -f 
".deps/helloworldtest.Tpo"; exit 1; \
kdevelop (output views): Stdout line: fi
kdevelop (output views): Stderr line: helloworldtest.c: In function `main':
kdevelop (output views): Stderr line: helloworldtest.c:25: `a' 
undeclared (first use in this function)
kdevelop (output views): Stderr line: helloworldtest.c:25: (Each 
undeclared identifier is reported only once
kdevelop (output views): Stderr line: helloworldtest.c:25: for each 
function it appears in.)
kdevelop (output views): Stderr line: helloworldtest.c:25: `b' 
undeclared (first use in this function)
kdevelop (output views): Stderr line: helloworldtest.c:25: `c' 
undeclared (first use in this function)
kdevelop (output views): Stderr line: helloworldtest.c:35: `other_error' 
undeclared (first use in this function)
kdevelop (output views): Stderr line: gmake[2]: *** [helloworldtest.o] 
Error 1
kdevelop (output views): Stdout line: if gcc -DHAVE_CONFIG_H -I. 
-I/home/kde-devel/helloworldtest/src -I..   
-I/usr/local/BerkeleyDB.4.1/include  -g -O2 -MT 
bug_check_helloworldtest.o -MD -MP -MF 
".deps/bug_check_helloworldtest.Tpo" \
kdevelop (output views): Stdout line:   -c -o bug_check_helloworldtest.o 
`test -f 'bug_check_helloworldtest.c' || echo 
'/home/kde-devel/helloworldtest/src/'`bug_check_helloworldtest.c; \
kdevelop (output views): Stdout line: then mv 
".deps/bug_check_helloworldtest.Tpo" ".deps/bug_check_helloworldtest.Po"; \
kdevelop (output views): Stdout line: else rm -f 
".deps/bug_check_helloworldtest.Tpo"; exit 1; \
kdevelop (output views): Stdout line: fi
kdevelop (output views): Stdout line: if gcc -DHAVE_CONFIG_H -I. 
-I/home/kde-devel/helloworldtest/src -I..   
-I/usr/local/BerkeleyDB.4.1/include  -g -O2 -MT this_is_helloworldtest.o 
-MD -MP -MF ".deps/this_is_helloworldtest.Tpo" \
kdevelop (output views): Stdout line:   -c -o this_is_helloworldtest.o 
`test -f 'this_is_helloworldtest.c' || echo 
'/home/kde-devel/helloworldtest/src/'`this_is_helloworldtest.c; \
kdevelop (output views): Stdout line: then mv 
".deps/this_is_helloworldtest.Tpo" ".deps/this_is_helloworldtest.Po"; \
kdevelop (output views): Stdout line: else rm -f 
".deps/this_is_helloworldtest.Tpo"; exit 1; \
kdevelop (output views): Stdout line: fi
kdevelop (output views): Stdout line: gmake[2]: Leaving directory 
`/home/kde-devel/helloworldtest/src'
kdevelop (output views): Stderr line: bug_check_helloworldtest.c: In 
function `bug_check_helloworldtest':
kdevelop (output views): Stderr line: bug_check_helloworldtest.c:15: 
`no_problem' undeclared (first use in this function)
kdevelop (output views): Stderr line: bug_check_helloworldtest.c:15: 
(Each undeclared identifier is reported only once
kdevelop (output views): Stderr line: bug_check_helloworldtest.c:15: for 
each function it appears in.)
kdevelop (output views): Stdout line: gmake[2]: Entering directory 
`/home/kde-devel/helloworldtest'
kdevelop (output views): Stdout line: gmake[2]: Nothing to be done for 
`all-am'.
kdevelop (output views): Stdout line: gmake[2]: Leaving directory 
`/home/kde-devel/helloworldtest'
kdevelop (output views): Stderr line: gmake[2]: *** 
[bug_check_helloworldtest.o] Error 1
kdevelop (output views): Stdout line: gmake[1]: Leaving directory 
`/home/kde-devel/helloworldtest'
kdevelop (output views): Stderr line: this_is_helloworldtest.c: In 
function `this_is_helloworldtest':
kdevelop (output views): Stderr line: this_is_helloworldtest.c:15: 
`asdfoasijdfjf' undeclared (first use in this function)
kdevelop (output views): Stderr line: this_is_helloworldtest.c:15: (Each 
undeclared identifier is reported only once
kdevelop (output views): Stderr line: this_is_helloworldtest.c:15: for 
each function it appears in.)
kdevelop (output views): Stderr line: gmake[2]: *** 
[this_is_helloworldtest.o] Error 1
kdevelop (output views): Stderr line: gmake[2]: Target `all' not remade 
because of errors.
kdevelop (output views): Stderr line: gmake[1]: *** [all-recursive] Error 1
kdevelop (output views): Stderr line: gmake: *** [all] Error 2


Because of this, the guess for the full path of this_is_helloworldtest.c 
is: /home/kde-devel/helloworldtest/this_is_helloworldtest.c, which is 
incorrect, so go to error doesn't work.

It looks like there are two ways to resolve this:

1. Better guessing of directory.  If we don't find it in the previous 
enter directory message, go back and try the enter directory message 
before that.

2. Make stderr and stdout be processed in correct order.

I think #2 is more ideal, but I am not sure if it is possible, which is 
why I am sending this email.


Here are some things I tried that didn't help: 

I tried making childproc a KProcess instead of KShellProcess (since the 
documentation says KShellProcess is deprecated)  and calling 
childproc->setUseShell(true).

I also tried making childproc a KProcIO, and connecting the readReady 
signal to a single insetLine slot, but the order was still wrong.


Maybe someone here knows how to make this work with KProcIO, or maybe we 
could pipe the stdout and stderr messages to a file and process them 
from the file.

Thanks,

-John







More information about the KDevelop-devel mailing list