simonkagstrom (simonkagstrom) wrote,

An illustrated guide to indexing the linux kernel in eclipse

I posted earlier about indexing the linux kernel in eclipse. After Jakob Engblom and a few people at work started following this, I realised it's probably a bit unclear. This post is just a condensed form of the earlier one but with helpful pictures! So, follow these steps to index the linux kernel with Eclipse Ganymede:
  • First download the script and place somewhere in your path

  • Create a new project of the type C project and select Makefile project/Other toolchain. Uncheck the Use default location checkbox, then enter the path to the kernel source:


  • Click next and select Advanced options

  • Select the C/C++ Build tab and uncheck Automated discovery of paths and symbols:


  • Select the C/C++ General tab and select no indexer


  • Remove the default includes from all languages and add kernel includes so that you have something like this:


    When adding includes, select Add to all languages and select a workspace path:


  • Select the Symbols tab and add the __KERNEL__ symbol:


    Again, add to all languages:


  • Press OK to return to the main eclipse window

  • Exclude non-needed architectures and includes by selecting paths in the project window, right clicking and selecting Exclude from build...:


    Do the same for unneeded includes

  • Run in the kernel directory, updating the eclipse project files:


  • Refresh the project in the project window and enter the project properties again. Enable the indexer:


  • Press OK

Eclipse will now index the kernel and after this you should be set to go. Indexing will obviously take some time, but it's saved between sessions so you can safely exit eclipse.
Comments for this post were disabled by the author