6

Configure vscode for linux kernel source code

 1 year ago
source link: https://gist.github.com/itewqq/4b4ee89ba420d585efb472116879b1ee
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Configure vscode for linux kernel source code · GitHub

Instantly share code, notes, and snippets.

Configure vscode for linux kernel source code
  1. Disable or uninstall the official C/C++ plugin.
  2. Install the clangd plugin.
  3. Build the kernel with clang:
/path/to/kernel_source$ make CC=clang defconfig
/path/to/kernel_source$ make CC=clang -j16
  1. Generate the compile_commands.json:
/path/to/kernel_source$ python ./scripts/clang-tools/gen_compile_commands.py

If no error occures, you will find compile_commands.json in /path/to/kernel_source/.

  1. Configure the clangd plugin with the following parameters:

image.png
  1. Open any C file in kernel source and enjoy it :)

image.png

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK