1. make LLVM=1 rust-analyzer
2. add rust-project.json to the rust-analyzer.linkedProjects
"rust-analyzer.linkedProjects": [
"rust-project.json",
]
# 生成compile_commands.json文件
python3 scripts/clang-tools/gen_compile_commands.py
# 安装clangd,并配置
{
"clangd.path": "/usr/bin/clangd-14",
"clangd.arguments": [
"--compile-commands-dir=${workspaceFolder}"
]
}
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: <https://go.microsoft.com/fwlink/?linkid=830387>
"version": "0.2.0",
"configurations": [
{
"name": "Remote attach",
"type": "lldb",
"request": "custom",
"targetCreateCommands": ["target create ${workspaceFolder}/vmlinux"],
"processCreateCommands": ["gdb-remote localhost:1234"]
}
]
}
Ref: https://github.com/google/syzkaller/blob/master/tools/create-image.sh