microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.54k stars 1.56k forks source link

Path of project files corrupted #3236

Closed noppej closed 5 years ago

noppej commented 5 years ago

Type: LanguageService

Describe the bug

I have inserted two screenshot examples below. Screenshots

Example 1: "/Users/Jack/SSTP/Motor" is my project root, and is prepended to the valid file name that starts at "/Users/Jack/SSTP/STM32" screen shot 2019-03-01 at 2 59 01 pm

Example 2: Similar to Example 1, but now the string "__isb" is inserted between the project root path and the file name screen shot 2019-03-01 at 2 36 49 pm

Example 3: Similar to 1 and 2, but the string "__IO FLASH_ProcedureTypef ... blah, blah, blah" is inserted in between the two path components. screen shot 2019-03-01 at 2 11 15 pm

c_cpp_properties.json

{
    "env": {
        "____________________USER_FIELDS_CAN_BE_MODIFIED____________________": "",
        "user_cSources": [
            "Src/sstpCommon.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/BSP/STM32F4xx-Nucleo/stm32f4xx_nucleo.c"
        ],
        "user_asmSources": [],
        "user_cIncludes": [
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/BSP/STM32F4xx-Nucleo"
        ],
        "user_asmIncludes": [],
        "user_cDefines": [
            "AVOID_EMPTY_DEFINE_FIELD_C",
            "__CC_ARM"
        ],
        "user_asmDefines": [
            "AVOID_EMPTY_DEFINE_FIELD_ASM"
        ],
        "user_cFlags": [
            "-fmessage-length=0 -Wall -Werror-implicit-function-declaration -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast"
        ],
        "user_asmFlags": [],
        "____________________DO_NOT_MODIFY_FIELDS_BELOW____________________": "",
        "cubemx_sourceFiles": [
            "Src/main.c",
            "Src/stm32f4xx_it.c",
            "Src/stm32f4xx_hal_msp.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c",
            "Src/system_stm32f4xx.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Middlewares/Third_Party/FreeRTOS/Source/croutine.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Middlewares/Third_Party/FreeRTOS/Source/event_groups.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Middlewares/Third_Party/FreeRTOS/Source/list.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Middlewares/Third_Party/FreeRTOS/Source/queue.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Middlewares/Third_Party/FreeRTOS/Source/tasks.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Middlewares/Third_Party/FreeRTOS/Source/timers.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c",
            "Src/freertos.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c",
            "startup_stm32f446xx.s"
        ],
        "cubemx_includes": [
            "Inc",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Inc",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Middlewares/Third_Party/FreeRTOS/Source/include",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/CMSIS/Include",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Drivers/CMSIS/Include",
            "/Users/Jack/SSTP/STM32Cube/STM32Cube_FW_F4_V1.24.0/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2"
        ],
        "cubemx_defines": [
            "USE_HAL_DRIVER",
            "STM32F446xx"
        ],
        "gccExePath": "/Users/Jack/Library/xPacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.2.1/.content/bin/arm-none-eabi-gcc",
        "gccIncludePath": "/Users/Jack/Library/xPacks/@gnu-mcu-eclipse/arm-none-eabi-gcc/8.2.1-1.2.1/.content/lib/gcc/arm-none-eabi/8.2.1/include"
    },
    "configurations": [
        {
            "name": "Motor",
            "intelliSenseMode": "clang-x64",
            "includePath": [
                "${workspaceFolder}",
                "${cubemx_includes}",
                "${user_cIncludes}",
                "${user_asmIncludes}"
            ],
            "browse": {
                "path": [
                    "${workspaceFolder}",
                    "${cubemx_includes}",
                    "${user_cIncludes}",
                    "${user_asmIncludes}"
                ],
                "limitSymbolsToIncludedHeaders": true
            },
            "defines": [
                "${cubemx_defines}",
                "${user_cDefines}",
                "${user_asmDefines}"
            ],
            "forcedInclude": [],
            "compilerPath": "${gccExePath}",
            "cStandard": "c11",
            "cppStandard": "c++17"
        }
    ],
    "version": 4
}
sean-mcmanus commented 5 years ago

Those errors are not coming from our extension. Do you have another C/C++ extension enabled?

noppej commented 5 years ago

I have no other extensions (apart from the 3 mentioned above). I suspect it has something to do with memory overflows as a result of the 1000's of build errors. It turns out these were caused by a suspect -D generated by STM32CubeMX (incorrect quoting). After fixing that problem, the build errors went away, and my "Problem" paths were no longer corrupted.
I appreciate the clarification that these were not from your extension. That clarification allowed me to look elsewhere.