Author Topic: Relative path in output build?  (Read 8363 times)

Offline gerardpuducul

  • Single posting newcomer
  • *
  • Posts: 8
Relative path in output build?
« on: December 10, 2008, 06:50:19 pm »
Hy all,

My compiler is a GNU AMR GCC. In is build output, he send me back relative path from the working directory for error and warning. I have modified my parser rule to retrieve the file, line, message information. But when I click on the highlited error in the build log (or build message) nothing happen.

Is codeblock support relative path output debug? Is there a way to support it?


Thanks

for example here is on of my error :
Quote
"..\..\source\th_rf.c", line 487: Serious error: C2291E: <expression> expected but found '/'


with my parser rule  :
Code
 (")(.*)("),( line) ([0-9]+):( Error:[ \t].*)

I have
filename : ..\..\source\th_rf.c
line number : 487
Message : Serious error

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Relative path in output build?
« Reply #1 on: December 10, 2008, 08:48:52 pm »
with my parser rule  :
Code
 (")(.*)("),( line) ([0-9]+):( Error:[ \t].*)
What about :
Code
 (")(.*)("),( line) ([0-9]+):( [Ee]rror:[ \t].*)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline gerardpuducul

  • Single posting newcomer
  • *
  • Posts: 8
Re: Relative path in output build?
« Reply #2 on: December 11, 2008, 10:13:40 am »
Yes of course there is a litlle mistake with my parser rule but this not solve my problem. The parse seems to be done correctly but when i click on the highlited build message nothing happen. Codeblock don't focus on the corrresponding file at the corresponding line (in fact it does nothing). This is why i ask if codeblock support relative path.


Anyway thank for your answer!

Do you have an explaination about this behaviour? can codeblock work with relative path?

thanks

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Relative path in output build?
« Reply #3 on: December 11, 2008, 10:55:38 am »
Jumping to relative filenames work for me.

Try this expression:
Code
"(.*)", line ([0-9]+): (.*)

and set Message to 3, Filename to 1 and line to 2.

That works for me with your error line:
Code
Regular expression analyzed as follows:

Type: Error message
Filename: ../../source/th_rf.c
Line number: 487
Message: Serious error: C2291E: <expression> expected but found '/'

Offline gerardpuducul

  • Single posting newcomer
  • *
  • Posts: 8
Re: Relative path in output build?
« Reply #4 on: December 11, 2008, 11:38:58 am »
Thanks your parse rule work better that mine (the message error is now complete). But this not solve my problem anymore. :( :(

Maybe due to my special configuration. I use a custom makefile and i launch the make process from a special directory :

Code
make -C C:\test\toto

Is it the possible?

thanks


Offline gerardpuducul

  • Single posting newcomer
  • *
  • Posts: 8
Re: Relative path in output build?
« Reply #5 on: December 11, 2008, 12:06:28 pm »
fiinally I found a solution!  :P I must change the projet directory to my custom makefile directory and now codeblock jump to the parse information! good!

but is it normal?

why codeblock use my project  directory for working directory instead of my custom makefile directory ?

Is there a way to do that? (I have try to change the execution working directory but it doen't seem to do something  :()

thanks!!!!

Offline mingkoonkat

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Relative path in output build?
« Reply #6 on: May 14, 2013, 06:25:34 pm »
FWIW, we also use a custom makefile system for the EPICS project which generates relative paths (with "./a/b/../c.c" in them), and so far I haven’t managed to work out how configure this IDE so that one can click on the error messages in order to vector the focus to the appropriate source file line. I did try locating the project directory where the custom makefile resides, as the previous posts suggest, with no success. I use code block 12.11 from Jan 10th.

../CASG.cpp||In member function ‘void CASG::destroyCompletedIO(CallbackGuard&, epicsGuard<epicsMutex>&)’:|
../CASG.cpp|151|error: no matching function for call to ‘syncGroupNotify::destroy(CallbackGuard&, epicsGuard<epicsMutex>&, CASG&)’|
../CASG.cpp|151|note: candidate is:|
../syncGroup.h|65|note: virtual void syncGroupNotify::destroy(epicsGuard<epicsMutex>&, casgRecycle&)|
../syncGroup.h|65|note:   candidate expects 2 arguments, 3 provided|
../CASG.cpp||In member function ‘void CASG::destroyPendingIO(CallbackGuard&, epicsGuard<epicsMutex>&)’:|
../CASG.cpp|161|error: no matching function for call to ‘syncGroupNotify::cancel(epicsGuard<epicsMutex>&)’|
../CASG.cpp|161|note: candidate is:|
../syncGroup.h|70|note: virtual void syncGroupNotify::cancel(CallbackGuard&, epicsGuard<epicsMutex>&)|
../syncGroup.h|70|note:   candidate expects 2 arguments, 1 provided|
../CASG.cpp||In member function ‘bool CASG::ioComplete(epicsGuard<epicsMutex>&)’:|
../CASG.cpp|209|error: no matching function for call to ‘CASG::destroyCompletedIO(epicsGuard<epicsMutex>&)’|
../CASG.cpp|209|note: candidate is:|
../CASG.cpp|144|note: void CASG::destroyCompletedIO(CallbackGuard&, epicsGuard<epicsMutex>&)|
../CASG.cpp|144|note:   candidate expects 2 arguments, 1 provided|
||=== Build finished: 3 errors, 0 warnings (0 minutes, 1 seconds) ===|
« Last Edit: May 14, 2013, 06:36:05 pm by mingkoonkat »

Offline mingkoonkat

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Relative path in output build?
« Reply #7 on: May 14, 2013, 07:47:03 pm »
OK, so when actually looking at the compiler output maybe its quite hard for C::B to deal with this issue (sorry).

Perhaps instead gcc could easily provide an option to output full paths in its diagnostic messages, even if relative paths are on its command line; unfortunately It appears that it doesn’t currently provide such an option.

Or we could amend our build system as suggested in this post.

http://gcc.gnu.org/ml/gcc-help/2008-03/msg00084.html

Offline mingkoonkat

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Relative path in output build?
« Reply #8 on: May 14, 2013, 08:44:27 pm »
 For completeness, in a gnu make based build system this fix works fine BTW (sorry this is rapidly diverging off topic).

%$(OBJ): %.c
    @$(RM) $@
-   $(COMPILE.c) -c $<
+   $(COMPILE.c) -c $(realpath $<)
 
 %$(OBJ): %.cc
    @$(RM) $@
-   $(COMPILE.cpp) -c $<
+   $(COMPILE.cpp) -c $(realpath $<)
 
 %$(OBJ): %.cpp
    @$(RM) $@
-   $(COMPILE.cpp) -c $<
+   $(COMPILE.cpp) -c $(realpath $<)