User forums > Using Code::Blocks

Help on code completion

(1/4) > >>

ouille:
Hello,

I use codeblocks to develop a linux kernel module. I manage to have the build process ok without error. Great !

But something goes wrong with code completion.

I have "add file recursively" added linux headers to my project. And code completion works as expected. I save the project.

If i close and re open codeblocks, codecompletion doesn't work any more. I need to "add file recursively" linux headers again to have correct behavior, but they are still in the project.

Am i doing something wrong ?

Thank for help.
Ouille

BlueHazzard:
What version of codeblocks are you using?

ouille:
Hello,

I use Codeblocks 17.12 : build jan 6 2018 10:12:19 , Windows 7 Pro

I've also tried "reparse this project" option without success.

It seem that parser doesn't run on headers on project loading ...

Have a nice day.
Ouille.

BlueHazzard:
Can you try the latest nightly build? There were some changes made with path management and cc...

In all the cc for codeblocks is not the best anymore... There are better in work, but this will take time to develop...
this is one that works quite nice, but it is hard to install.. you may have a look at it https://github.com/yvesdm3000/ClangLib/tree/staging

ouille:
Hello,

I'm trying again.

I just manage to compile codeblocks from svn trunk. So i think i work on the last release.

Here is what i found :
Loading project which contain single .c file and all linux kernel headers files, here is the parsing log :

--- Quote ---NativeParser::DoFullParsing(): AddProjectDefinedMacros failed!
NativeParser::DoFullParsing(): Adding cpp/c files to batch-parser
NativeParser::DoFullParsing(): Added 1 source file(s) for project 'cb_module' to batch-parser...
NativeParser::CreateParser(): Finish creating a new parser for project 'cb_module'
NativeParser::OnParserStart(): Starting batch parsing for project 'cb_module'...
NativeParser::OnParserEnd(): Project 'cb_module' parsing stage done!
Project 'cb_module' parsing stage done (9748 total parsed files, 272 tokens in 0 minute(s), 0.196 seconds).
--- End quote ---

Reparsing project :


--- Quote ---NativeParser::DeleteParser(): Deleting parser for project 'cb_module'!
NativeParser::DoFullParsing(): AddProjectDefinedMacros failed!
NativeParser::DoFullParsing(): Adding cpp/c files to batch-parser
NativeParser::DoFullParsing(): Added 1 source file(s) for project 'cb_module' to batch-parser...
NativeParser::CreateParser(): Finish creating a new parser for project 'cb_module'
NativeParser::OnParserStart(): Starting batch parsing for project 'cb_module'...
NativeParser::OnParserEnd(): Project 'cb_module' parsing stage done!
Project 'cb_module' parsing stage done (9748 total parsed files, 272 tokens in 0 minute(s), 0.177 seconds).
--- End quote ---

Adding recursively linux kernel headers files


--- Quote ---NativeParser::OnParserStart(): Starting add file parsing for project 'cb_module'...
... Lots of :
ReadVarNames() : Unexpected token '((packed))' for 'v4l2_event_vsync', file '/usr/src/linux-headers-4.4.0-130/include/uapi/linux/videodev2.h', line 2046.
ReadVarNames() : Unexpected token '((packed))' for 'v4l2_dbg_match', file '/usr/src/linux-headers-4.4.0-130/include/uapi/linux/videodev2.h', line 2143.
ReadVarNames() : Unexpected token '((packed))' for 'v4l2_dbg_register', file '/usr/src/linux-headers-4.4.0-130/include/uapi/linux/videodev2.h', line 2150.
ReadVarNames() : Unexpected token '((packed))' for 'v4l2_dbg_chip_info', file '/usr/src/linux-headers-4.4.0-130/include/uapi/linux/videodev2.h', line 2161.
...
Project 'cb_module' parsing stage done (9935 total parsed files, 494443 tokens in 0 minute(s), 34.161 seconds).
--- End quote ---

At this point everything is ok !

Reparsing project :


--- Quote ---Reparsing when typing for editor /home/jl/Modules/cb_module/mod1.c
NativeParser::OnParserStart(): Starting re-parsing for project 'cb_module'...
Project 'cb_module' parsing stage done (9935 total parsed files, 494444 tokens in 0 minute(s), 0.005 seconds).
NativeParser::DeleteParser(): Deleting parser for project 'cb_module'!
NativeParser::DoFullParsing(): AddProjectDefinedMacros failed!
NativeParser::DoFullParsing(): Adding cpp/c files to batch-parser
NativeParser::DoFullParsing(): Added 1 source file(s) for project 'cb_module' to batch-parser...
NativeParser::CreateParser(): Finish creating a new parser for project 'cb_module'
NativeParser::OnParserStart(): Starting batch parsing for project 'cb_module'...
NativeParser::OnParserEnd(): Project 'cb_module' parsing stage done!
Project 'cb_module' parsing stage done (9748 total parsed files, 272 tokens in 0 minute(s), 0.150 seconds).
--- End quote ---

As i can debug codecompletion i'll continue to try to find what is going wrong.

Any idea welcome.

I have now to fully understand code completion code ... ouch

Have a nice day.
Ouille

Navigation

[0] Message Index

[#] Next page

Go to full version