Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the Visual Studio Code to navigate Linux kernel source

I am converting from Eclipse CDT. The preprocessor macro feature is a must when navigating through C/C++ code with preprocessor defines (whether explicitly specified in Makefile or included through an external auto-generated header file). Without this, navigating the Linux source would be impossible, as described on this seminal wiki page on using Eclipse to study the Linux code. I am looking for an equivalent feature for Visual Studio Code. Would appreciate a pointer.

like image 713
Henry Choi Avatar asked Mar 20 '26 14:03

Henry Choi


1 Answers

  1. Install ms-vscode.cpptools extension.
  2. Open kernel source folder in VSCode.
  3. Follow the instructions, add "${workspaceFolder}/include" and "${workspaceFolder}/arch/{your arch}/include" to includePath, "your arch" is x86/arm etc.
  4. Wait for IntelliSence indexing.
like image 179
tinytaro Avatar answered Mar 23 '26 03:03

tinytaro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!