Bug type: Language Service
The system I'm working on runs on embedded MIPS processors with a kernel based on linux-4.5.3. One of our source files has a call to copy_from_user() which is defined in .../linux-4.5.3/arch/mips/include/asm/uaccess.h straight from the distribution, but VS Code erroneously warns "unknown register name '$4'" and similarly for $5 and $6.
I assume this is because the C/C++ extensions lacks a "linux-gcc-mips" IntelliSense mode that wold teach it about these registers, so it would be great if you could add one, helpful if you could let me know how to write one of my own, or at least useful if there was a way to turn off asm-snooping when the tool has no idea about the assembler in question.
-
OS and Version:
Ubuntu 18.04 LTS with cross-compiler tools for MIPS.
-
VS Code Version:
Version: 1.58.2
Commit: c3f126316369cd610563c75b1b1725e0679adfb3
Date: 2021-07-14T22:30:16.440Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Linux x64 4.15.0-122-generic
-
C/C++ Extension Version:
1.5.1
Steps to reproduce
C code with a call to copy_from_user().
Expected behavior
The tool should not warn about calls to copy_from_user(), nor any other code that uses asm() to embed assembler in a language that the tool does not supports.
Code sample and logs
c_cpp_properties.json snippet...
{
"name": "MIPS-Linux-Modules",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/../linux/kernel/linux-4.5.3/include",
"${workspaceFolder}/../linux/kernel/linux-4.5.3/arch/mips/include",
"${workspaceFolder}/../linux/kernel/linux-4.5.3/arch/mips/include/asm/mach-generic",
"${workspaceFolder}/../linux/kernel/linux-4.5.3/arch/mips/include/generated",
"${workspaceFolder}/../linux/kernel/linux-4.5.3/arch/mips/include/generated/uapi",
"${workspaceFolder}/../linux/kernel/linux-4.5.3/arch/mips/include/uapi"
],
"defines": [
"ARCH=mips",
"MIPS_LINUX",
// stuff from .../DEV_ROOT/linux/kernel/linux-4.5.3/scripts/link-vmlinux.sh
"CONFIG_MIPS=y",
"CONFIG_RWSEM_GENERIC_SPINLOCK=y"
],
"compilerPath": "/devtools/mips-mti-linux-gnu/bin/mips-mti-linux-gnu-gcc",
"cStandard": "gnu11",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-gcc-arm64",
"compilerArgs": [
"-march=interaptiv"
],
"browse": {
"path": [
"${workspaceFolder}/**"
],
"limitSymbolsToIncludedHeaders": true
}
},
Screenshots
Additional context
Bug type: Language Service
The system I'm working on runs on embedded MIPS processors with a kernel based on linux-4.5.3. One of our source files has a call to copy_from_user() which is defined in .../linux-4.5.3/arch/mips/include/asm/uaccess.h straight from the distribution, but VS Code erroneously warns "unknown register name '$4'" and similarly for $5 and $6.
I assume this is because the C/C++ extensions lacks a "linux-gcc-mips" IntelliSense mode that wold teach it about these registers, so it would be great if you could add one, helpful if you could let me know how to write one of my own, or at least useful if there was a way to turn off asm-snooping when the tool has no idea about the assembler in question.
OS and Version:
Ubuntu 18.04 LTS with cross-compiler tools for MIPS.
VS Code Version:
Version: 1.58.2
Commit: c3f126316369cd610563c75b1b1725e0679adfb3
Date: 2021-07-14T22:30:16.440Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Linux x64 4.15.0-122-generic
C/C++ Extension Version:
1.5.1
Steps to reproduce
C code with a call to copy_from_user().
Expected behavior
The tool should not warn about calls to copy_from_user(), nor any other code that uses asm() to embed assembler in a language that the tool does not supports.
Code sample and logs
Code sample
Configurations in
c_cpp_properties.jsonc_cpp_properties.json snippet...
Logs from running
C/C++: Log Diagnosticsfrom the VS Code command paletteLogs from the language server logging
Screenshots
Additional context