Open zcjie1 opened 2 months ago
All definitions aren't found? Is the Outline view always empty for active files?
With C_Cpp.loggingLevel set to "Debug" do you ever see any "tag parsing" messages (or error messages), such as after making an edit?
When you run C/C++: Log Diagnostics from the command palette, what does it show after the Browse Paths from compile_commands.json, from workspace folder:
logging and what paths in that list do not work with go to definition?
@sean-mcmanus
In version 1.21.6
The Outline view is always empty and show "loading document symbols for "xxx.c"..."
There is no "tag parsing" message in debug log when edit the file, but in the next image when hover on " Rescan workspace":
In version 1.17.5
The Outline view is normal
Hi @zcjie1 . Could you enable the setting "C_Cpp.loggingLevel": "Debug"
and provide the log output from the C/C++ output channel, from startup until the repro? I suspect the issue may be that the compiler command line isn't being correctly interpreted. The log output may help clarify that. It would also be useful to know whether that log output stalls (or logs only 'received' messages and doesn't 'invoke' them). If so, the last 'invoked' message logged may provide us some clues. Or is it continuing to actively output to the log the whole time?
Also, do you know if you have any symbolic links under your workspace folder? We have a known issue where a symbolic link that creates a circular reference could cause hang on startup. (This should be addressed in our next release, 1.22.0)
@Colengms .
The complete debug information: debug.log
There are exactly some symbolic link files under the workspace folder, but I don't think they cause circular references:
find linux -type l linux/tools/testing/selftests/powerpc/vphn/vphn.c linux/tools/testing/selftests/powerpc/vphn/asm/lppaca.h linux/tools/testing/selftests/powerpc/stringloops/memcmp_64.S linux/tools/testing/selftests/powerpc/stringloops/memcmp_32.S linux/tools/testing/selftests/powerpc/stringloops/strlen_32.S linux/tools/testing/selftests/powerpc/primitives/word-at-a-time.h linux/tools/testing/selftests/powerpc/primitives/asm/feature-fixups.h linux/tools/testing/selftests/powerpc/primitives/asm/asm-const.h linux/tools/testing/selftests/powerpc/primitives/asm/ppc_asm.h linux/tools/testing/selftests/powerpc/primitives/asm/asm-compat.h linux/tools/testing/selftests/powerpc/primitives/asm/extable.h linux/tools/testing/selftests/powerpc/nx-gzip/include/vas-api.h linux/tools/testing/selftests/powerpc/copyloops/memcpy_64.S linux/tools/testing/selftests/powerpc/copyloops/copyuser_power7.S linux/tools/testing/selftests/powerpc/copyloops/copy_mc_64.S linux/tools/testing/selftests/powerpc/copyloops/memcpy_power7.S linux/tools/testing/selftests/powerpc/copyloops/copyuser_64.S linux/arch/x86_64/boot/bzImage linux/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v1.2.dts linux/arch/arm/boot/dts/sun8i-a33-ippo-q8h-v1.2.dts linux/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts linux/arch/arm/boot/dts/sun8i-a33-et-q8-v1.6.dts linux/arch/arm64/boot/dts/arm/vexpress-v2m-rs1.dtsi linux/include/dt-bindings/input/linux-event-codes.h linux/include/dt-bindings/clock/qcom,dispcc-sm8150.h linux/Documentation/Changes linux/scripts/dummy-tools/objcopy linux/scripts/dummy-tools/nm linux/scripts/dtc/include-prefixes/arc linux/scripts/dtc/include-prefixes/mips linux/scripts/dtc/include-prefixes/powerpc linux/scripts/dtc/include-prefixes/openrisc linux/scripts/dtc/include-prefixes/nios2 linux/scripts/dtc/include-prefixes/sh linux/scripts/dtc/include-prefixes/microblaze linux/scripts/dtc/include-prefixes/arm linux/scripts/dtc/include-prefixes/dt-bindings linux/scripts/dtc/include-prefixes/h8300 linux/scripts/dtc/include-prefixes/arm64 linux/scripts/dtc/include-prefixes/xtensa
Hi @zcjie1 . I see a bunch of the following in your log:
Unable to access browse database
I've actually not seen this before. Usually an issue accessing the browse database is reported as an error opening it. Perhaps the database exists but cannot be written to, or is in a path you no longer have permission to?
Could you try setting an explicit path for a browse database to a known-good location using the C_Cpp.default.browse.databaseFilename
setting or in c_cpp_properties.json
using the browse.databaseFilename
field?
@Colengms
When I set C_Cpp.default.browse.databaseFilename
to customized path, it works.
I find the default databaseFile in the Windows system because of WSL2 environment:
I have sufficient permissions to access the databaseFile, but why Unable to access browse database
?
By the way, it woreks in version 1.17.5 without changing the default databaseFile.
Hi @zcjie1 . Just to confirm, did you have to go all the way back to 1.17.5 to resolve the issue? (There are some pre-release versions after 1.17.5, but since we don't currently have a pre-release out, the marketplace UI might not be making old pre-releases available to install. They can be found in the Releases section here in our repo.)
Also, I'm not sure that's the path used for projects opened in your Linux remote. That looks like the path used for project opened locally on Windows.
There was a change in 1.18.0:
Switch to using XDG_CACHE_HOME on Linux for the default database path. https://github.com/microsoft/vscode-cpptools/issues/10191
Is it possible the issue has something to do with the value of that var, or the permission of the path it refers to?
@Colengms .
I recursively change the owner of ~/.cache/vscode-cpptools
(originally root) , and it works.
I'm not sure if I mistakenly used the root user to install VS Code on WSL2, or if there's an issue with the initialization code of the extension?
Hi @zcjie1 . The account used to create the directory should have been the account the directory is under. The C/C++ Extension doesn't directly deal with file system account permissions. It assumes the permissions provided by VS Code should be sufficient and consistent. It's possible there was an issue with VS Code in which the wrong account permissions were used, or perhaps permissions on the folder or database were changed for some other reason.
We can use this issue to track adding checking of the permissions of the database path and existing database file.
Environment
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
Other Extensions
No response
Additional context
No response