Skip to main content
Jump to: navigation, search

Difference between revisions of "HowTo use the CDT to navigate Linux kernel source"

(Simplified instructions, because of bug-ridden configuration management in Eclipse, and also used Advance Settings so as not to have to stop the indexing.)
(Migrated to GitHub)
 
(30 intermediate revisions by 9 users not shown)
Line 1: Line 1:
Here are some steps that I've found to get the CDT to work well with the Linux kernel source. If you exclude some of these steps, it may still work to a large degree, but some things may not work exactly right; for example it may find the wrong include file for a C file.
+
{{warning|Note: The contents of this page has been migrated. Please see https://github.com/eclipse-cdt/cdt/tree/main/FAQ#whats-the-best-way-to-set-up-the-cdt-to-navigate-linux-kernel-source for current information, or page history for historical versions. }}
 
+
Anyway, as you do these steps, I think you may understand how they assist the indexer to do a good job for the Linux kernel source.
+
 
+
''Disclaimer: these steps were developed for Eclipse 3.5.1 + CDT 6.0.0.''
+
 
+
#Download and install Eclipse plus the CDT.
+
#Configure and build your kernel. This can be done before or after downloading and installing Eclipse.
+
#Start up Eclipse.
+
#Click '''File'''->'''New'''->'''C Project'''
+
#Fill in a project name like ''my_kernel''
+
#Uncheck the '''Use default location''' box and type in the root directory of your kernel into the '''Location''' box.  
+
#In the '''Project type:''' pane, click the '''Makefile project''' and select '''Empty Project'''
+
#On the right side, select '''Linux GCC'''
+
#Click '''Advanced settings...''' and a Properties dialog will pop up.
+
#Select '''Resource''' on the left, and then in the '''Text file encoding''' section, select '''Other''' and '''ISO-8859-1''' in the box, then click '''Apply'''
+
#Select '''C/C++ Build''' on the left.
+
#Open the '''C/C++ General''' selection on the left.
+
#Click on '''Indexer'''
+
#Checkmark the '''Enable project specific setttings''' box.
+
#Uncheck '''Index source files not included in the build'''
+
#Clear out the '''Files to index up-front''' box.
+
#Click on '''Paths and Symbols''' on the left.
+
#Select the '''Includes''' tab and then select '''GNU C'''
+
#Click '''Add...'''
+
#Click '''Workspace...''' then select your kernel's {{Code|include}} directory
+
#Do another Add, Workspace and add {{Code|arch/}}''architecture''{{Code|/include}}, e.g., {{Code|arch/powerpc/include}}
+
#Click the '''# Symbols''' tab
+
#Click '''Add...'''
+
#Set the name to {{Code|__KERNEL__}}
+
#Set the value to {{Code|1}} and click '''OK'''
+
#Click the '''Source Location''' tab
+
#Click the twisty for your project.
+
#Select the '''Filter''' item and click '''Edit Filter...'''
+
#Click '''Add Multiple...''' and then select all of the {{Code|arch/*}} directories in your kernel source that will not be used (i.e. all the ones that are not for the architecture you are using)
+
#Click '''OK''' and '''OK''' again to dismiss that dialog.
+
#Click '''OK''' on the Properties dialog.
+
#Click '''Finish''' on the C Project dialog.
+
#Right click on the project and select '''Index''' then select '''Rebuild'''
+
#It will take about 20 minutes or so to complete.
+
 
+
Corey Ashford [mailto:cjashfor@us.ibm.com cjashfor@us.ibm.com]
+

Latest revision as of 10:05, 9 November 2022

Warning2.png
Note: The contents of this page has been migrated. Please see https://github.com/eclipse-cdt/cdt/tree/main/FAQ#whats-the-best-way-to-set-up-the-cdt-to-navigate-linux-kernel-source for current information, or page history for historical versions.

Back to the top