microsoft / microsoft/vscode-cpptools

Add permission check to database path instead of failing silently

Open
#12,542 10 comments 0 reactions 1 assignee View on GitHub

@sean-mcmanus is already working on this.

Since Aug 5, 2024.

bug Feature: Document Symbol Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and Version: Windows11-->WSL2-->Ubuntu22.04
  • VS Code Version: 1.91.1
  • C/C++ Extension Version: 1.21.x
Bug Summary and Steps to Reproduce

Bug Summary:

In WSL2, I compiled the Linux source code (version 5.15) and generated the compile_commands.json file using the script provided with the Linux source code.

Next, I added the path to the compile_commands.json file in the c_cpp_properties.json configuration and it was a long time wait.

when I attempted to navigate to the definitions of functions or variables, I encountered issues where the IDE indicated that these symbols were undefined.

I tested several versions of the extension, including those from the 1.21.x, 1.20.x, 1.19.x, 1.18.x, and 1.17.x series, but not every single version within each series. The ability to navigate to the definition of functions or variables worked as expected in version 1.17.5.

ps: when in VMware VM Ubuntu22.04 with remote ssh in Windows 11, the navigate ability works as expected in version 1.21.4.

Configuration and Logs
c_cpp_properties.json:
{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "cStandard": "gnu11",
            "cppStandard": "gnu++17",
            "intelliSenseMode": "${default}",
            "compileCommands": "compile_commands.json",
            "compilerPath": "",
            "dotConfig": "",
            "compilerArgs": []
        }
    ],
    "version": 4
}


item in compile_commands.json:
{
  "command": "gcc -Wp,-MMD,block/.bdev.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/11/include -I./arch/x86/include -I./arch/x86/include/generated  -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mindirect-branch-cs-prefix -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=2048 -fstack-protector-strong -Wimplicit-fallthrough=5 -Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-stack-clash-protection -g -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -Wno-alloc-size-larger-than -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned    -DKBUILD_MODFILE='\"block/bdev\"' -DKBUILD_BASENAME='\"bdev\"' -DKBUILD_MODNAME='\"bdev\"' -D__KBUILD_MODNAME=kmod_bdev -c -o block/bdev.o block/bdev.c",
  "directory": "/home/zcj/linux",
  "file": "/home/zcj/linux/block/bdev.c"
},
Other Extensions

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.