Skip to content

Instantly share code, notes, and snippets.

@cnwzhu
cnwzhu / vscode-for-linux-kernel.md
Created November 7, 2023 03:07 — forked from itewqq/vscode-for-linux-kernel.md
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