User forums > Using Code::Blocks

Arduino - incorrect parsing

(1/3) > >>

zdena:
Hello,
I use C::B for Arduino programming via original Arduino-builder.

During Building I have got all messages from Arduino-builder in the C::B "Build log" tab. On the end are the warnings and errors ?parsed? into the "Build messages" tab. It is still OK. :)

But Arduino-builder works in the (strange) way that:

* main file (named Project_Name.ino) is copied in some temp\Project_Name\build\sketch\ and renamed to the Projedct_Name.cpp.
* Other Sources and Headers from the project directory are copied there and from there are all compiled.
* Another libraries (cpp sources and h headers) stay where they are and are compiled from there.The problem is that warnings and errors concerning the Sources and Headers from the project directory are refered to the files in temporary directory but not to the original sources. :(
Is there a way (if yes, which way please) how to (conditionally) redirect the output parsing?

Something like this:

   if (warning is from ...\Project_Name\build\sketch\file.cpp)
      then {go to ...\Project_Name\file.cpp }
      else {change nothing}

I expect that "Advanced compiler options -> Output parsing" could solve this, but I'm really not familiar with regular expression unfortunately. :-[

Thanks Zdena

oBFusCATed:
There is not such thing.
You have two options:
1. Start reading the code of the compiler and find where to apply path remapping.
2. Start reading arduino-builder's code and find how to insert #line (https://docs.microsoft.com/en-us/cpp/preprocessor/hash-line-directive-c-cpp?view=vs-2019) directive which will do the remapping and this would work in any IDE. I guess you can try to convince the arduino devs to do this themselves, but I don't know if they would be willing to do this.

zdena:
Thank you oBFusCATed for your hints.

I thought about it a few days and what about:

  3. Start reading C::B's code and apply path remapping somewhere there?

Is it possible? Or this way is totally wrong?

stahta01:
4. Write a small program the prepends the #line to the start of each temp file created by arduino-builder.

Note: I would first edit one of the temp files to verify whether the #line command works as you want.

Tim S.

oBFusCATed:

--- Quote from: zdena on June 12, 2019, 02:17:48 pm ---  3. Start reading C::B's code and apply path remapping somewhere there?

--- End quote ---
This is the same as 1. I've forgotten to mention that I'm talking about the C::B's compiler plugin.
But the chances for this getting included in svn trunk is really slim.
The implementation must be efficient, minimal and clean for this to happen.

Navigation

[0] Message Index

[#] Next page

Go to full version