VS Code is a common editor at CSE. Here is some basic guidance for setting up to be more useful.
C properties
The following is a basic json file to set up the properties for some of Code's features and IntelliSense to work.
Note that the supplied code base is quite complex with differing compiler flags for different parts of the code base. The supplied config below seems to work for the part of the codebase that you will spend the majority of your time in.
Also observe that some include files (and directories) are generated after the first build, so Code may complain about the properties if you have not built the codebase yet.
Download c_cpp_properties.json or cut-n-paste the following into .vscode/c_cpp_properties.json
at the top of your source tree.
{ "configurations": [ { "name": "AOS", "includePath": [ "${workspaceFolder}/build/libsel4/autoconf", "${workspaceFolder}/build/kernel/gen_config", "${workspaceFolder}/build/libsel4/gen_config", "${workspaceFolder}/projects/sel4runtime/include", "${workspaceFolder}/projects/sel4runtime/include/mode/64", "${workspaceFolder}/projects/sel4runtime/include/sel4_arch/aarch64", "${workspaceFolder}/kernel/libsel4/include", "${workspaceFolder}/kernel/libsel4/arch_include/arm", "${workspaceFolder}/kernel/libsel4/sel4_arch_include/aarch64", "${workspaceFolder}/kernel/libsel4/sel4_plat_include/odroidc2", "${workspaceFolder}/kernel/libsel4/mode_include/64", "${workspaceFolder}/build/libsel4/include", "${workspaceFolder}/build/libsel4/arch_include/arm", "${workspaceFolder}/build/libsel4/sel4_arch_include/aarch64", "${workspaceFolder}/build/projects/musllibc/build-temp/stage/include", "${workspaceFolder}/projects/libelf/include", "${workspaceFolder}/projects/libcpio/include", "${workspaceFolder}/projects/aos/libnetworkconsole/include", "${workspaceFolder}/build/projects/libpicotcp/picotcp_external/picotcp/build/include", "${workspaceFolder}/build/projects/libpicotcp/gen_config", "${workspaceFolder}/projects/aos/libsosapi/include", "${workspaceFolder}/projects/libutils/include", "${workspaceFolder}/projects/libutils/arch_include/arm", "${workspaceFolder}/build/projects/libutils/gen_config", "${workspaceFolder}/build/projects/aos/sos/gen_config", "${workspaceFolder}/projects/aos/libdebugger/include", "${workspaceFolder}/projects/aos/libclock/include", "${workspaceFolder}/projects/aos/libsel4cspace/include", "${workspaceFolder}/projects/aos/libaos/include", "${workspaceFolder}/projects/picotcp-bsd", "${workspaceFolder}/libnfs/lib/../include", "${workspaceFolder}/libnfs/rquota", "${workspaceFolder}/libnfs/portmap", "${workspaceFolder}/libnfs/nsm", "${workspaceFolder}/libnfs/nlm", "${workspaceFolder}/libnfs/nfs4", "${workspaceFolder}/libnfs/nfs", "${workspaceFolder}/libnfs/mount", "${workspaceFolder}/projects/aos/libethernet/include", "${workspaceFolder}/projects/libgdb/include", "${workspaceFolder}/projects/libco" ], "defines": [ "STDSOCKET", "_SYS_POLL_H", "__KERNEL_64__" ], "compilerPath": "/usr/bin/aarch64-linux-gnu-gcc", "cStandard": "gnu11", "cppStandard": "gnu++11", "intelliSenseMode": "linux-gcc-arm64", "compilerArgs": [ "-nostdinc" ], "forcedInclude": [ "${workspaceFolder}/.vscode/preinclude.h" ] } ], "version": 4 }
Additionally, download or create preinclude.h in .vscode/preinclude.h.
#undef __linux__
Debugging inside VS Code
We do support GDB-based debugging on the command line. However, we are yet to coax VS Code and GDB to work together. If you manage to get them working together, please let us know.
See the debugging page for information on debugging strategies applicable to the project.
Compiling inside VS Code
We have not attempted to build the source tree from within VS Code. Feel free to try to configure it and let us know if you manage to get it going.