用vscode阅读linux kernel

Posted focus

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了用vscode阅读linux kernel相关的知识,希望对你有一定的参考价值。

1. 移除多余文件

  因为linux kernel文件数量过多,会导致系统很慢。

  在File->prefenrence->setting->workspace, 右上角有个切换到json文件,编辑如下:

{
    "search.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.DS_Store": true,
        "**/drivers": true,
        "**/sound": true,
        "**/tools": true,
        "**/arch/alpha": true,
        "**/arch/arc": true,
        "**/arch/c6x": true,
        "**/arch/h8300": true,
        "**/arch/hexagon": true,
        "**/arch/ia64": true,
        "**/arch/m32r": true,
        "**/arch/m68k": true,
        "**/arch/microblaze": true,
        "**/arch/mn10300": true,
        "**/arch/nds32": true,
        "**/arch/nios2": true,
        "**/arch/parisc": true,
        "**/arch/powerpc": true,
        "**/arch/s390": true,
        "**/arch/sparc": true,
        "**/arch/score": true,
        "**/arch/sh": true,
        "**/arch/um": true,
        "**/arch/unicore32": true,
        "**/arch/xtensa": true
    },

    //-------- Files configuration --------

    // Configure glob patterns for excluding files and folders.
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.DS_Store": true,
        "**/drivers": true,
        "**/sound": true,
        "**/tools": true,
        "**/arch/alpha": true,
        "**/arch/arc": true,
        "**/arch/c6x": true,
        "**/arch/h8300": true,
        "**/arch/hexagon": true,
        "**/arch/ia64": true,
        "**/arch/m32r": true,
        "**/arch/m68k": true,
        "**/arch/microblaze": true,
        "**/arch/mn10300": true,
        "**/arch/nds32": true,
        "**/arch/nios2": true,
        "**/arch/parisc": true,
        "**/arch/powerpc": true,
        "**/arch/s390": true,
        "**/arch/sparc": true,
        "**/arch/score": true,
        "**/arch/sh": true,
        "**/arch/um": true,
        "**/arch/unicore32": true,
        "**/arch/xtensa": true
    }
}

2. 修复有些头文件路径查找不到

  可自行添加头文件路径

  ctrl+shift+P: 输入>edit configurations,选择json文件编辑,添加如下:

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/arch/arm64/include/**",
                "${workspaceFolder}/include/**",
                "${workspaceFolder}/arch/arm64/**",
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}

 PS:ubuntu wine安装的程序卸载:wine uninstaller,执行后会有弹窗提示可卸载的软件

以上是关于用vscode阅读linux kernel的主要内容,如果未能解决你的问题,请参考以下文章

vscode 阅读 linux kernel 源码

Linux 内核Linux 内核源码结构 ( 下载 Linux 内核源码 | 使用 VSCode 阅读 Linux 内核源码 )

[首发][Ubuntu]VSCode搭建Linux Kernel单步调试IDE环境

VSCode 阅读 Linux 代码怎么才不卡顿?这样做才能快的飞起!

使用VScode创建ipynb文件选择kernel运行python代码

visual studio 阅读 linux-kernel