Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors shown on includes from MIPS g++ cross-compiler #5113

Closed
gentooise opened this issue Mar 13, 2020 · 22 comments
Closed

Errors shown on includes from MIPS g++ cross-compiler #5113

gentooise opened this issue Mar 13, 2020 · 22 comments
Assignees
Labels
bug Feature: Compile Commands Feature: Configuration An issue related to configuring the extension or IntelliSense Language Service more info needed The issue report is not actionable in its current state
Milestone

Comments

@gentooise
Copy link

gentooise commented Mar 13, 2020

Type: LanguageService

Describe the bug

  • OS and Version: Lubuntu 18.04
  • VS Code Version: 1.43.0
  • C/C++ Extension Version: 0.27.0-insiders2
  • Other extensions you installed (and if the issue persists after disabling them): CMake Tools (the issue persists even disabling this other extension and removing configurationProvider setting).

Steps to reproduce
I have only this settings.json:

{
    "cmake.autoRestartBuild": true,
    "cmake.buildBeforeRun": false,
    "cmake.sourceDirectory": "${workspaceRoot}",
    "cmake.buildDirectory": "${workspaceRoot}/build",

    "C_Cpp.loggingLevel": "Debug",
    "C_Cpp.updateChannel": "Insiders",
    "C_Cpp.default.cStandard": "c99",
    "C_Cpp.default.cppStandard": "c++03",
    "C_Cpp.default.intelliSenseMode": "gcc-x86",
    "C_Cpp.default.configurationProvider": "vector-of-bool.cmake-tools",
    "C_Cpp.default.compilerPath": "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/bin/mipsel-poky-linux-musl/mipsel-poky-linux-musl-g++",
    "C_Cpp.default.compileCommands": "${workspaceRoot}/build/compile_commands.json"
}

When starting VSCode, the include path of the cross compiler is correctly indexed but I see two main problems:

  1. the plugin does a first attempt on '/usr/bin/gcc' (which is unwanted);
  2. the plugin is not able to query the given compiler.

Expected behavior
Cpp extension correctly queries the compiler given in settings.json.

Logs
initialized
cpptools/queryCompilerDefaults: 1
Attempting to get defaults from compiler found on the machine: '/usr/bin/gcc'
terminating child process: 1317
Attempting to get defaults from compiler found on the machine: '/usr/bin/gcc'
terminating child process: 1320
Custom browse configuration received: {
  "browsePath": [
      [...] // <-- list of all my src folders here
  ],
  "standard": "c++98",
  "compilerPath": "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/bin/mipsel-poky-linux-musl/mipsel-poky-linux-musl-g++",
  "compilerArgs": [
    "-fpermissive",
    "-g",
    "-std=gnu++98"
  ]
}
cpptools/fileCreated
cpptools/fileCreated
cpptools/fileCreated
cpptools/didChangeCppProperties
Attempting to get defaults from compiler in "compilerPath" property: '/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/bin/mipsel-poky-linux-musl/mipsel-poky-linux-musl-g++'
Compiler does not support 32-bit. Falling back to 64-bit intelliSenseMode.
terminating child process: 1322
Failed to query compiler. Falling back to no bitness.
terminating child process: 1323
terminating child process: 1324
Code browsing service initialized
Attempting to get defaults from compiler in "compilerPath" property: '/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/bin/mipsel-poky-linux-musl/mipsel-poky-linux-musl-g++'
Compiler does not support 32-bit. Falling back to 64-bit intelliSenseMode.
terminating child process: 1326
Failed to query compiler. Falling back to no bitness.
terminating child process: 1327
terminating child process: 1328
  Folder: /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include/ will be indexed
  Folder: /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include-fixed/ will be indexed
[...]

Screenshots

image

image

Also, if I Ctrl-click on <stdint.h>, the correct file is opened and I see this:
image

Additional context

I can correctly query the compiler manually:

Command
xxx@yyy:~$ /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/bin/mipsel-poky-linux-musl/mipsel-poky-linux-musl-g++ -dM -E - < /dev/null
#define __DBL_MIN_EXP__ (-1021)
#define __HQ_FBIT__ 15
#define __UINT_LEAST16_MAX__ 0xffff
#define __ATOMIC_ACQUIRE 2
#define __SFRACT_IBIT__ 0
#define __FLT_MIN__ 1.1754943508222875e-38F
#define __GCC_IEC_559_COMPLEX 1
#define __UFRACT_MAX__ 0XFFFFP-16UR
#define __UINT_LEAST8_TYPE__ unsigned char
#define __DQ_FBIT__ 63
#define __INTMAX_C(c) c ## LL
#define __ULFRACT_FBIT__ 32
#define __SACCUM_EPSILON__ 0x1P-7HK
#define __CHAR_BIT__ 8
#define __USQ_IBIT__ 0
#define __UINT8_MAX__ 0xff
#define __ACCUM_FBIT__ 15
#define __WINT_MAX__ 0xffffffffU
#define R3000 1
#define __USFRACT_FBIT__ 8
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __SIZE_MAX__ 0xffffffffU
#define __WCHAR_MAX__ 0x7fffffff
#define __LACCUM_IBIT__ 32
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __DBL_DENORM_MIN__ ((double)4.9406564584124654e-324L)
#define __GCC_ATOMIC_CHAR_LOCK_FREE 2
#define __GCC_IEC_559 1
#define __FLT_EVAL_METHOD__ 0
#define __unix__ 1
#define __LLACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LLK
#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __FRACT_FBIT__ 15
#define _MIPS_ISA _MIPS_ISA_MIPS1
#define __UINT_FAST64_MAX__ 0xffffffffffffffffULL
#define __SIG_ATOMIC_TYPE__ int
#define __UACCUM_FBIT__ 16
#define __LANGUAGE_C 1                                                                                                                                                                                 
#define __DBL_MIN_10_EXP__ (-307)                                                                                                                                                                      
#define __FINITE_MATH_ONLY__ 0                                                                                                                                                                         
#define _MIPS_TUNE "mips1"                                                                                                                                                                             
#define _ABIO32 1                                                                                                                                                                                      
#define __LFRACT_IBIT__ 0                                                                                                                                                                              
#define __GNUC_PATCHLEVEL__ 0                                                                                                                                                                          
#define __LFRACT_MAX__ 0X7FFFFFFFP-31LR                                                                                                                                                                
#define __UINT_FAST8_MAX__ 0xff
#define __has_include(STR) __has_include__(STR)
#define __DEC64_MAX_EXP__ 385
#define __INT8_C(c) c
#define __UINT_LEAST64_MAX__ 0xffffffffffffffffULL
#define __SA_FBIT__ 15
#define __SHRT_MAX__ 0x7fff
#define __LDBL_MAX__ 1.7976931348623157e+308L
#define __FRACT_MAX__ 0X7FFFP-15R
#define __UFRACT_FBIT__ 16
#define __UFRACT_MIN__ 0.0UR
#define __UINT_LEAST8_MAX__ 0xff
#define __GCC_ATOMIC_BOOL_LOCK_FREE 2
#define __mips_abicalls 1
#define __LANGUAGE_C__ 1
#define __UINTMAX_TYPE__ long long unsigned int
#define __LLFRACT_EPSILON__ 0x1P-63LLR
#define __linux 1
#define __DEC32_EPSILON__ 1E-6DF
#define __unix 1
#define __UINT32_MAX__ 0xffffffffU
#define __ULFRACT_MAX__ 0XFFFFFFFFP-32ULR
#define __TA_IBIT__ 64
#define __LDBL_MAX_EXP__ 1024
#define __WINT_MIN__ 0U
#define __MIPSEL__ 1
#define __linux__ 1
#define __ULLFRACT_MIN__ 0.0ULLR
#define __SCHAR_MAX__ 0x7f
#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
#define __INT64_C(c) c ## LL
#define __DBL_DIG__ 15
#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
#define __LLACCUM_MIN__ (-0X1P31LLK-0X1P31LLK)
#define __SIZEOF_INT__ 4
#define __SIZEOF_POINTER__ 4
#define __USACCUM_IBIT__ 8
#define __USER_LABEL_PREFIX__ 
#define __STDC_HOSTED__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __LFRACT_MIN__ (-0.5LR-0.5LR)
#define __mips_fpr 32
#define __HA_IBIT__ 8
#define __TQ_IBIT__ 0
#define __FLT_EPSILON__ 1.1920928955078125e-7F
#define __mips__ 1
#define __USFRACT_IBIT__ 0
#define __LDBL_MIN__ 2.2250738585072014e-308L
#define __STDC_UTF_16__ 1
#define __FRACT_MIN__ (-0.5R-0.5R)
#define __DEC32_MAX__ 9.999999E96DF
#define __DA_IBIT__ 32
#define MIPSEL 1
#define __INT32_MAX__ 0x7fffffff
#define __UQQ_FBIT__ 8
#define __SIZEOF_LONG__ 4
#define __UACCUM_MAX__ 0XFFFFFFFFP-16UK
#define __UINT16_C(c) c
#define __DECIMAL_DIG__ 17
#define __LFRACT_EPSILON__ 0x1P-31LR
#define __ULFRACT_MIN__ 0.0ULR
#define __gnu_linux__ 1
#define __has_include_next(STR) __has_include_next__(STR)
#define __LDBL_HAS_QUIET_NAN__ 1
#define __ULACCUM_IBIT__ 32
#define __UACCUM_EPSILON__ 0x1P-16UK
#define __GNUC__ 5
#define __ULLACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULLK
#define __HQ_IBIT__ 0
#define __FLT_HAS_DENORM__ 1
#define __SIZEOF_LONG_DOUBLE__ 8
#define _R3000 1
#define __BIGGEST_ALIGNMENT__ 8
#define __GNUC_STDC_INLINE__ 1
#define __DQ_IBIT__ 0
#define __DBL_MAX__ ((double)1.7976931348623157e+308L)
#define __ULFRACT_IBIT__ 0
#define __INT_FAST32_MAX__ 0x7fffffff
#define __DBL_HAS_INFINITY__ 1
#define __ACCUM_IBIT__ 16
#define __DEC32_MIN_EXP__ (-94)
#define __LACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LK
#define __INT_FAST16_TYPE__ int
#define __LDBL_HAS_DENORM__ 1
#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
#define __INT_LEAST32_MAX__ 0x7fffffff
#define __DEC32_MIN__ 1E-95DF
#define __ACCUM_MAX__ 0X7FFFFFFFP-15K
#define __DBL_MAX_EXP__ 1024
#define __USACCUM_EPSILON__ 0x1P-8UHK
#define __R3000__ 1
#define __DEC128_EPSILON__ 1E-33DL
#define __SFRACT_MAX__ 0X7FP-7HR
#define __FRACT_IBIT__ 0
#define __PTRDIFF_MAX__ 0x7fffffff
#define __UACCUM_MIN__ 0.0UK
#define mips 1
#define __UACCUM_IBIT__ 16
#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL
#define __SIZEOF_SIZE_T__ 4
#define __ULACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULK
#define _MIPS_ARCH_MIPS1 1
#define __SIZEOF_WINT_T__ 4
#define __SA_IBIT__ 16
#define __ULLACCUM_MIN__ 0.0ULLK
#define __GXX_ABI_VERSION 1009
#define __UTA_FBIT__ 64
#define __FLT_MIN_EXP__ (-125)
#define __USFRACT_MAX__ 0XFFP-8UHR
#define __UFRACT_IBIT__ 0
#define __INT_FAST64_TYPE__ long long int
#define _MIPSEL 1
#define __DBL_MIN__ ((double)2.2250738585072014e-308L)
#define _MIPS_ARCH "mips1"
#define _MIPS_SPFPSET 16
#define __LACCUM_MIN__ (-0X1P31LK-0X1P31LK)
#define __ULLACCUM_FBIT__ 32
#define __ULLFRACT_EPSILON__ 0x1P-64ULLR
#define __DEC128_MIN__ 1E-6143DL
#define __REGISTER_PREFIX__ $
#define __UINT16_MAX__ 0xffff
#define __DBL_HAS_DENORM__ 1
#define __ACCUM_MIN__ (-0X1P15K-0X1P15K)
#define __SQ_IBIT__ 0
#define __UINT8_TYPE__ unsigned char
#define __UHA_FBIT__ 8
#define __NO_INLINE__ 1
#define __SFRACT_MIN__ (-0.5HR-0.5HR)
#define __R3000 1
#define __UTQ_FBIT__ 128
#define __FLT_MANT_DIG__ 24
#define __VERSION__ "5.4.0"
#define __UINT64_C(c) c ## ULL
#define __ULLFRACT_FBIT__ 64
#define __FRACT_EPSILON__ 0x1P-15R
#define __ULACCUM_MIN__ 0.0ULK
#define __UDA_FBIT__ 32
#define __LLACCUM_EPSILON__ 0x1P-31LLK
#define _MIPS_TUNE_MIPS1 1
#define __GCC_ATOMIC_INT_LOCK_FREE 2
#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __USFRACT_MIN__ 0.0UHR
#define __UQQ_IBIT__ 0
#define __INT32_C(c) c
#define __DEC64_EPSILON__ 1E-15DD
#define __ORDER_PDP_ENDIAN__ 3412
#define __DEC128_MIN_EXP__ (-6142)
#define __UHQ_FBIT__ 16
#define __LLACCUM_FBIT__ 31
#define __INT_FAST32_TYPE__ int
#define __UINT_LEAST16_TYPE__ short unsigned int
#define unix 1
#define __INT16_MAX__ 0x7fff
#define __SIZE_TYPE__ unsigned int
#define __UINT64_MAX__ 0xffffffffffffffffULL
#define __UDQ_FBIT__ 64
#define __INT8_TYPE__ signed char
#define __ELF__ 1
#define __ULFRACT_EPSILON__ 0x1P-32ULR
#define __LLFRACT_FBIT__ 63
#define __FLT_RADIX__ 2
#define __INT_LEAST16_TYPE__ short int
#define __LDBL_EPSILON__ 2.2204460492503131e-16L
#define __UINTMAX_C(c) c ## ULL
#define __SACCUM_MAX__ 0X7FFFP-7HK
#define __SIG_ATOMIC_MAX__ 0x7fffffff
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __SIZEOF_PTRDIFF_T__ 4
#define __LACCUM_EPSILON__ 0x1P-31LK
#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
#define __INT_FAST16_MAX__ 0x7fffffff
#define _MIPS_SZPTR 32
#define __UINT_FAST32_MAX__ 0xffffffffU
#define __UINT_LEAST64_TYPE__ long long unsigned int
#define __USACCUM_MAX__ 0XFFFFP-8UHK
#define __SFRACT_EPSILON__ 0x1P-7HR
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MAX_10_EXP__ 38
#define __LONG_MAX__ 0x7fffffffL
#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
#define __FLT_HAS_INFINITY__ 1
#define __USA_FBIT__ 16
#define __UINT_FAST16_TYPE__ unsigned int
#define __DEC64_MAX__ 9.999999999999999E384DD
#define __CHAR16_TYPE__ short unsigned int
#define __PRAGMA_REDEFINE_EXTNAME 1
#define __INT_LEAST16_MAX__ 0x7fff
#define __DEC64_MANT_DIG__ 16
#define __INT64_MAX__ 0x7fffffffffffffffLL
#define __UINT_LEAST32_MAX__ 0xffffffffU
#define __SACCUM_FBIT__ 7
#define __GCC_ATOMIC_LONG_LOCK_FREE 2
#define __INT_LEAST64_TYPE__ long long int
#define __INT16_TYPE__ short int
#define __INT_LEAST8_TYPE__ signed char
#define _mips 1
#define __STDC_VERSION__ 201112L
#define __SQ_FBIT__ 31
#define __DEC32_MAX_EXP__ 97
#define __INT_FAST8_MAX__ 0x7f
#define __INTPTR_MAX__ 0x7fffffff
#define __QQ_FBIT__ 7
#define linux 1
#define __UTA_IBIT__ 64
#define _MIPS_SZINT 32
#define __LDBL_MANT_DIG__ 53
#define __SFRACT_FBIT__ 7
#define __SACCUM_MIN__ (-0X1P7HK-0X1P7HK)
#define __DBL_HAS_QUIET_NAN__ 1
#define __MIPSEL 1
#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
#define __INTPTR_TYPE__ int
#define __UINT16_TYPE__ short unsigned int
#define __WCHAR_TYPE__ int
#define __SIZEOF_FLOAT__ 4
#define __USQ_FBIT__ 32
#define __pic__ 1
#define __UINTPTR_MAX__ 0xffffffffU
#define __DEC64_MIN_EXP__ (-382)
#define __ULLACCUM_IBIT__ 32
#define __INT_FAST64_MAX__ 0x7fffffffffffffffLL
#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
#define __FLT_DIG__ 6
#define __UINT_FAST64_TYPE__ long long unsigned int
#define __INT_MAX__ 0x7fffffff
#define __LACCUM_FBIT__ 31
#define __USACCUM_MIN__ 0.0UHK
#define __UHA_IBIT__ 8
#define __INT64_TYPE__ long long int
#define __FLT_MAX_EXP__ 128
#define __UTQ_IBIT__ 0
#define _MIPS_SIM _ABIO32
#define __DBL_MANT_DIG__ 53
#define __INT_LEAST64_MAX__ 0x7fffffffffffffffLL
#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __DEC64_MIN__ 1E-383DD
#define __WINT_TYPE__ unsigned int
#define __UINT_LEAST32_TYPE__ unsigned int
#define __SIZEOF_SHORT__ 2
#define __ULLFRACT_IBIT__ 0
#define __LDBL_MIN_EXP__ (-1021)
#define _MIPS_FPSET 16
#define __UDA_IBIT__ 32
#define __INT_LEAST8_MAX__ 0x7f
#define __LFRACT_FBIT__ 31
#define __LDBL_MAX_10_EXP__ 308
#define __ATOMIC_RELAXED 0
#define __DBL_EPSILON__ ((double)2.2204460492503131e-16L)
#define __UINT8_C(c) c
#define __INT_LEAST32_TYPE__ int
#define __SIZEOF_WCHAR_T__ 4
#define __UINT64_TYPE__ long long unsigned int
#define __LLFRACT_MAX__ 0X7FFFFFFFFFFFFFFFP-63LLR
#define __TQ_FBIT__ 127
#define __INT_FAST8_TYPE__ signed char
#define __ULLACCUM_EPSILON__ 0x1P-32ULLK
#define __UHQ_IBIT__ 0
#define __LLACCUM_IBIT__ 32
#define __DBL_DECIMAL_DIG__ 17
#define __STDC_UTF_32__ 1
#define __DEC_EVAL_METHOD__ 2
#define __TA_FBIT__ 63
#define __UDQ_IBIT__ 0
#define __ORDER_BIG_ENDIAN__ 4321
#define __ACCUM_EPSILON__ 0x1P-15K
#define __UINT32_C(c) c ## U
#define __INTMAX_MAX__ 0x7fffffffffffffffLL
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __FLT_DENORM_MIN__ 1.4012984643248171e-45F
#define __LLFRACT_IBIT__ 0
#define __INT8_MAX__ 0x7f
#define __PIC__ 1
#define __UINT_FAST32_TYPE__ unsigned int
#define __CHAR32_TYPE__ unsigned int
#define __FLT_MAX__ 3.4028234663852886e+38F
#define LANGUAGE_C 1
#define __USACCUM_FBIT__ 8
#define __INT32_TYPE__ int
#define __SIZEOF_DOUBLE__ 8
#define __FLT_MIN_10_EXP__ (-37)
#define __UFRACT_EPSILON__ 0x1P-16UR
#define __INTMAX_TYPE__ long long int
#define _LANGUAGE_C 1
#define __DEC128_MAX_EXP__ 6145
#define __ATOMIC_CONSUME 1
#define __GNUC_MINOR__ 4
#define __UINTMAX_MAX__ 0xffffffffffffffffULL
#define __DEC32_MANT_DIG__ 7
#define __HA_FBIT__ 7
#define __DBL_MAX_10_EXP__ 308
#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
#define __INT16_C(c) c
#define __STDC__ 1
#define __mips_hard_float 1
#define __PTRDIFF_TYPE__ int
#define __LLFRACT_MIN__ (-0.5LLR-0.5LLR)
#define __mips 1
#define __ATOMIC_SEQ_CST 5
#define __DA_FBIT__ 31
#define __UINT32_TYPE__ unsigned int
#define _MIPS_SZLONG 32
#define __UINTPTR_TYPE__ unsigned int
#define __USA_IBIT__ 16
#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
#define __DEC128_MANT_DIG__ 34
#define __LDBL_MIN_10_EXP__ (-307)
#define __SIZEOF_LONG_LONG__ 8
#define __ULACCUM_EPSILON__ 0x1P-32ULK
#define __SACCUM_IBIT__ 8
#define __GCC_ATOMIC_LLONG_LOCK_FREE 1
#define __LDBL_DIG__ 15
#define __FLT_DECIMAL_DIG__ 9
#define __UINT_FAST16_MAX__ 0xffffffffU
#define __GCC_ATOMIC_SHORT_LOCK_FREE 2
#define __ULLFRACT_MAX__ 0XFFFFFFFFFFFFFFFFP-64ULLR
#define __UINT_FAST8_TYPE__ unsigned char
#define __USFRACT_EPSILON__ 0x1P-8UHR
#define __ULACCUM_FBIT__ 32
#define __QQ_IBIT__ 0
#define __ATOMIC_ACQ_REL 4
#define __ATOMIC_RELEASE 3
@michelleangela
Copy link
Contributor

@gentooise

The extension does not fully support IntelliSense for MIPS, but could you try manually querying the compiler again with the arguments -Wp,-v -E -dD -x c++ /dev/null?

Could you also share the logs from the language server and compile_commands.json?

the plugin does a first attempt on '/usr/bin/gcc' (which is unwanted)

The extension will always try to query a default compiler regardless if there is a different compiler path specified. It will only use the info from the default compiler if it fails to get info from a specified compiler.

@michelleangela michelleangela added Language Service more info needed The issue report is not actionable in its current state labels Mar 13, 2020
@gentooise
Copy link
Author

gentooise commented Mar 16, 2020

The extension does not fully support IntelliSense for MIPS, but could you try manually querying the compiler again with the arguments -Wp,-v -E -dD -x c++ /dev/null?

Sure, the output below:

compiler output
xxx@yyy-vm:~ $ /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/bin/mipsel-poky-linux-musl/mipsel-poky-linux-musl-g++ -Wp,-v -E -dD -x c++ /dev/null
ignoring nonexistent directory "/not/exist/usr/include/c++/5.4.0"
ignoring nonexistent directory "/not/exist/usr/include/c++/5.4.0/mipsel-poky-linux"
ignoring nonexistent directory "/not/exist/usr/include/c++/5.4.0/backward"
ignoring nonexistent directory "/not/exist/usr/lib/gcc/mipsel-poky-linux/5.4.0/include"
ignoring nonexistent directory "/not/exist/usr/local/include"
ignoring nonexistent directory "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/../../../../../mipsel-poky-linux/include"
ignoring nonexistent directory "/not/exist/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include
 /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include-fixed
End of search list.
# 1 "/dev/null"
# 1 "<built-in>"
#define __STDC__ 1
#define __cplusplus 199711L
#define __STDC_HOSTED__ 1
#define __GNUC__ 5
#define __GNUC_MINOR__ 4
#define __GNUC_PATCHLEVEL__ 0
#define __VERSION__ "5.4.0"
#define __ATOMIC_RELAXED 0
#define __ATOMIC_SEQ_CST 5
#define __ATOMIC_ACQUIRE 2
#define __ATOMIC_RELEASE 3
#define __ATOMIC_ACQ_REL 4
#define __ATOMIC_CONSUME 1
#define __pic__ 1
#define __PIC__ 1
#define __FINITE_MATH_ONLY__ 0
#define __SIZEOF_INT__ 4
#define __SIZEOF_LONG__ 4
#define __SIZEOF_LONG_LONG__ 8
#define __SIZEOF_SHORT__ 2
#define __SIZEOF_FLOAT__ 4
#define __SIZEOF_DOUBLE__ 8
#define __SIZEOF_LONG_DOUBLE__ 8
#define __SIZEOF_SIZE_T__ 4
#define __CHAR_BIT__ 8
#define __BIGGEST_ALIGNMENT__ 8
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __ORDER_BIG_ENDIAN__ 4321
#define __ORDER_PDP_ENDIAN__ 3412
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __SIZEOF_POINTER__ 4
#define __GNUG__ 5
#define __SIZE_TYPE__ unsigned int
#define __PTRDIFF_TYPE__ int
#define __WCHAR_TYPE__ int
#define __WINT_TYPE__ unsigned int
#define __INTMAX_TYPE__ long long int
#define __UINTMAX_TYPE__ long long unsigned int
#define __CHAR16_TYPE__ short unsigned int
#define __CHAR32_TYPE__ unsigned int
#define __SIG_ATOMIC_TYPE__ int
#define __INT8_TYPE__ signed char
#define __INT16_TYPE__ short int
#define __INT32_TYPE__ int
#define __INT64_TYPE__ long long int
#define __UINT8_TYPE__ unsigned char
#define __UINT16_TYPE__ short unsigned int
#define __UINT32_TYPE__ unsigned int
#define __UINT64_TYPE__ long long unsigned int
#define __INT_LEAST8_TYPE__ signed char
#define __INT_LEAST16_TYPE__ short int
#define __INT_LEAST32_TYPE__ int
#define __INT_LEAST64_TYPE__ long long int
#define __UINT_LEAST8_TYPE__ unsigned char
#define __UINT_LEAST16_TYPE__ short unsigned int
#define __UINT_LEAST32_TYPE__ unsigned int
#define __UINT_LEAST64_TYPE__ long long unsigned int
#define __INT_FAST8_TYPE__ signed char
#define __INT_FAST16_TYPE__ int
#define __INT_FAST32_TYPE__ int
#define __INT_FAST64_TYPE__ long long int
#define __UINT_FAST8_TYPE__ unsigned char
#define __UINT_FAST16_TYPE__ unsigned int
#define __UINT_FAST32_TYPE__ unsigned int
#define __UINT_FAST64_TYPE__ long long unsigned int
#define __INTPTR_TYPE__ int
#define __UINTPTR_TYPE__ unsigned int
#define __has_include(STR) __has_include__(STR)
#define __has_include_next(STR) __has_include_next__(STR)
#define __GXX_WEAK__ 1
#define __DEPRECATED 1
#define __GXX_RTTI 1
#define __cpp_rtti 199711
#define __cpp_binary_literals 201304
#define __cpp_runtime_arrays 198712
#define __EXCEPTIONS 1
#define __cpp_exceptions 199711
#define __GXX_ABI_VERSION 1009
#define __SCHAR_MAX__ 0x7f
#define __SHRT_MAX__ 0x7fff
#define __INT_MAX__ 0x7fffffff
#define __LONG_MAX__ 0x7fffffffL
#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL
#define __WCHAR_MAX__ 0x7fffffff
#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
#define __WINT_MAX__ 0xffffffffU
#define __WINT_MIN__ 0U
#define __PTRDIFF_MAX__ 0x7fffffff
#define __SIZE_MAX__ 0xffffffffU
#define __INTMAX_MAX__ 0x7fffffffffffffffLL
#define __INTMAX_C(c) c ## LL
#define __UINTMAX_MAX__ 0xffffffffffffffffULL
#define __UINTMAX_C(c) c ## ULL
#define __SIG_ATOMIC_MAX__ 0x7fffffff
#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
#define __INT8_MAX__ 0x7f
#define __INT16_MAX__ 0x7fff
#define __INT32_MAX__ 0x7fffffff
#define __INT64_MAX__ 0x7fffffffffffffffLL
#define __UINT8_MAX__ 0xff
#define __UINT16_MAX__ 0xffff
#define __UINT32_MAX__ 0xffffffffU
#define __UINT64_MAX__ 0xffffffffffffffffULL
#define __INT_LEAST8_MAX__ 0x7f
#define __INT8_C(c) c
#define __INT_LEAST16_MAX__ 0x7fff
#define __INT16_C(c) c
#define __INT_LEAST32_MAX__ 0x7fffffff
#define __INT32_C(c) c
#define __INT_LEAST64_MAX__ 0x7fffffffffffffffLL
#define __INT64_C(c) c ## LL
#define __UINT_LEAST8_MAX__ 0xff
#define __UINT8_C(c) c
#define __UINT_LEAST16_MAX__ 0xffff
#define __UINT16_C(c) c
#define __UINT_LEAST32_MAX__ 0xffffffffU
#define __UINT32_C(c) c ## U
#define __UINT_LEAST64_MAX__ 0xffffffffffffffffULL
#define __UINT64_C(c) c ## ULL
#define __INT_FAST8_MAX__ 0x7f
#define __INT_FAST16_MAX__ 0x7fffffff
#define __INT_FAST32_MAX__ 0x7fffffff
#define __INT_FAST64_MAX__ 0x7fffffffffffffffLL
#define __UINT_FAST8_MAX__ 0xff
#define __UINT_FAST16_MAX__ 0xffffffffU
#define __UINT_FAST32_MAX__ 0xffffffffU
#define __UINT_FAST64_MAX__ 0xffffffffffffffffULL
#define __INTPTR_MAX__ 0x7fffffff
#define __UINTPTR_MAX__ 0xffffffffU
#define __GCC_IEC_559 1
#define __GCC_IEC_559_COMPLEX 1
#define __FLT_EVAL_METHOD__ 0
#define __DEC_EVAL_METHOD__ 2
#define __FLT_RADIX__ 2
#define __FLT_MANT_DIG__ 24
#define __FLT_DIG__ 6
#define __FLT_MIN_EXP__ (-125)
#define __FLT_MIN_10_EXP__ (-37)
#define __FLT_MAX_EXP__ 128
#define __FLT_MAX_10_EXP__ 38
#define __FLT_DECIMAL_DIG__ 9
#define __FLT_MAX__ 3.4028234663852886e+38F
#define __FLT_MIN__ 1.1754943508222875e-38F
#define __FLT_EPSILON__ 1.1920928955078125e-7F
#define __FLT_DENORM_MIN__ 1.4012984643248171e-45F
#define __FLT_HAS_DENORM__ 1
#define __FLT_HAS_INFINITY__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __DBL_MANT_DIG__ 53
#define __DBL_DIG__ 15
#define __DBL_MIN_EXP__ (-1021)
#define __DBL_MIN_10_EXP__ (-307)
#define __DBL_MAX_EXP__ 1024
#define __DBL_MAX_10_EXP__ 308
#define __DBL_DECIMAL_DIG__ 17
#define __DBL_MAX__ double(1.7976931348623157e+308L)
#define __DBL_MIN__ double(2.2250738585072014e-308L)
#define __DBL_EPSILON__ double(2.2204460492503131e-16L)
#define __DBL_DENORM_MIN__ double(4.9406564584124654e-324L)
#define __DBL_HAS_DENORM__ 1
#define __DBL_HAS_INFINITY__ 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __LDBL_MANT_DIG__ 53
#define __LDBL_DIG__ 15
#define __LDBL_MIN_EXP__ (-1021)
#define __LDBL_MIN_10_EXP__ (-307)
#define __LDBL_MAX_EXP__ 1024
#define __LDBL_MAX_10_EXP__ 308
#define __DECIMAL_DIG__ 17
#define __LDBL_MAX__ 1.7976931348623157e+308L
#define __LDBL_MIN__ 2.2250738585072014e-308L
#define __LDBL_EPSILON__ 2.2204460492503131e-16L
#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
#define __LDBL_HAS_DENORM__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_HAS_QUIET_NAN__ 1
#define __DEC32_MANT_DIG__ 7
#define __DEC32_MIN_EXP__ (-94)
#define __DEC32_MAX_EXP__ 97
#define __DEC32_MIN__ 1E-95DF
#define __DEC32_MAX__ 9.999999E96DF
#define __DEC32_EPSILON__ 1E-6DF
#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
#define __DEC64_MANT_DIG__ 16
#define __DEC64_MIN_EXP__ (-382)
#define __DEC64_MAX_EXP__ 385
#define __DEC64_MIN__ 1E-383DD
#define __DEC64_MAX__ 9.999999999999999E384DD
#define __DEC64_EPSILON__ 1E-15DD
#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
#define __DEC128_MANT_DIG__ 34
#define __DEC128_MIN_EXP__ (-6142)
#define __DEC128_MAX_EXP__ 6145
#define __DEC128_MIN__ 1E-6143DL
#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
#define __DEC128_EPSILON__ 1E-33DL
#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
#define __SFRACT_FBIT__ 7
#define __SFRACT_IBIT__ 0
#define __SFRACT_MIN__ (-0.5HR-0.5HR)
#define __SFRACT_MAX__ 0X7FP-7HR
#define __SFRACT_EPSILON__ 0x1P-7HR
#define __USFRACT_FBIT__ 8
#define __USFRACT_IBIT__ 0
#define __USFRACT_MIN__ 0.0UHR
#define __USFRACT_MAX__ 0XFFP-8UHR
#define __USFRACT_EPSILON__ 0x1P-8UHR
#define __FRACT_FBIT__ 15
#define __FRACT_IBIT__ 0
#define __FRACT_MIN__ (-0.5R-0.5R)
#define __FRACT_MAX__ 0X7FFFP-15R
#define __FRACT_EPSILON__ 0x1P-15R
#define __UFRACT_FBIT__ 16
#define __UFRACT_IBIT__ 0
#define __UFRACT_MIN__ 0.0UR
#define __UFRACT_MAX__ 0XFFFFP-16UR
#define __UFRACT_EPSILON__ 0x1P-16UR
#define __LFRACT_FBIT__ 31
#define __LFRACT_IBIT__ 0
#define __LFRACT_MIN__ (-0.5LR-0.5LR)
#define __LFRACT_MAX__ 0X7FFFFFFFP-31LR
#define __LFRACT_EPSILON__ 0x1P-31LR
#define __ULFRACT_FBIT__ 32
#define __ULFRACT_IBIT__ 0
#define __ULFRACT_MIN__ 0.0ULR
#define __ULFRACT_MAX__ 0XFFFFFFFFP-32ULR
#define __ULFRACT_EPSILON__ 0x1P-32ULR
#define __LLFRACT_FBIT__ 63
#define __LLFRACT_IBIT__ 0
#define __LLFRACT_MIN__ (-0.5LLR-0.5LLR)
#define __LLFRACT_MAX__ 0X7FFFFFFFFFFFFFFFP-63LLR
#define __LLFRACT_EPSILON__ 0x1P-63LLR
#define __ULLFRACT_FBIT__ 64
#define __ULLFRACT_IBIT__ 0
#define __ULLFRACT_MIN__ 0.0ULLR
#define __ULLFRACT_MAX__ 0XFFFFFFFFFFFFFFFFP-64ULLR
#define __ULLFRACT_EPSILON__ 0x1P-64ULLR
#define __SACCUM_FBIT__ 7
#define __SACCUM_IBIT__ 8
#define __SACCUM_MIN__ (-0X1P7HK-0X1P7HK)
#define __SACCUM_MAX__ 0X7FFFP-7HK
#define __SACCUM_EPSILON__ 0x1P-7HK
#define __USACCUM_FBIT__ 8
#define __USACCUM_IBIT__ 8
#define __USACCUM_MIN__ 0.0UHK
#define __USACCUM_MAX__ 0XFFFFP-8UHK
#define __USACCUM_EPSILON__ 0x1P-8UHK
#define __ACCUM_FBIT__ 15
#define __ACCUM_IBIT__ 16
#define __ACCUM_MIN__ (-0X1P15K-0X1P15K)
#define __ACCUM_MAX__ 0X7FFFFFFFP-15K
#define __ACCUM_EPSILON__ 0x1P-15K
#define __UACCUM_FBIT__ 16
#define __UACCUM_IBIT__ 16
#define __UACCUM_MIN__ 0.0UK
#define __UACCUM_MAX__ 0XFFFFFFFFP-16UK
#define __UACCUM_EPSILON__ 0x1P-16UK
#define __LACCUM_FBIT__ 31
#define __LACCUM_IBIT__ 32
#define __LACCUM_MIN__ (-0X1P31LK-0X1P31LK)
#define __LACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LK
#define __LACCUM_EPSILON__ 0x1P-31LK
#define __ULACCUM_FBIT__ 32
#define __ULACCUM_IBIT__ 32
#define __ULACCUM_MIN__ 0.0ULK
#define __ULACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULK
#define __ULACCUM_EPSILON__ 0x1P-32ULK
#define __LLACCUM_FBIT__ 31
#define __LLACCUM_IBIT__ 32
#define __LLACCUM_MIN__ (-0X1P31LLK-0X1P31LLK)
#define __LLACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LLK
#define __LLACCUM_EPSILON__ 0x1P-31LLK
#define __ULLACCUM_FBIT__ 32
#define __ULLACCUM_IBIT__ 32
#define __ULLACCUM_MIN__ 0.0ULLK
#define __ULLACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULLK
#define __ULLACCUM_EPSILON__ 0x1P-32ULLK
#define __QQ_FBIT__ 7
#define __QQ_IBIT__ 0
#define __HQ_FBIT__ 15
#define __HQ_IBIT__ 0
#define __SQ_FBIT__ 31
#define __SQ_IBIT__ 0
#define __DQ_FBIT__ 63
#define __DQ_IBIT__ 0
#define __TQ_FBIT__ 127
#define __TQ_IBIT__ 0
#define __UQQ_FBIT__ 8
#define __UQQ_IBIT__ 0
#define __UHQ_FBIT__ 16
#define __UHQ_IBIT__ 0
#define __USQ_FBIT__ 32
#define __USQ_IBIT__ 0
#define __UDQ_FBIT__ 64
#define __UDQ_IBIT__ 0
#define __UTQ_FBIT__ 128
#define __UTQ_IBIT__ 0
#define __HA_FBIT__ 7
#define __HA_IBIT__ 8
#define __SA_FBIT__ 15
#define __SA_IBIT__ 16
#define __DA_FBIT__ 31
#define __DA_IBIT__ 32
#define __TA_FBIT__ 63
#define __TA_IBIT__ 64
#define __UHA_FBIT__ 8
#define __UHA_IBIT__ 8
#define __USA_FBIT__ 16
#define __USA_IBIT__ 16
#define __UDA_FBIT__ 32
#define __UDA_IBIT__ 32
#define __UTA_FBIT__ 64
#define __UTA_IBIT__ 64
#define __REGISTER_PREFIX__ $
#define __USER_LABEL_PREFIX__ 
#define __GNUC_GNU_INLINE__ 1
#define __NO_INLINE__ 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __GCC_ATOMIC_BOOL_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __GCC_ATOMIC_SHORT_LOCK_FREE 2
#define __GCC_ATOMIC_INT_LOCK_FREE 2
#define __GCC_ATOMIC_LONG_LOCK_FREE 2
#define __GCC_ATOMIC_LLONG_LOCK_FREE 1
#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
#define __GCC_HAVE_DWARF2_CFI_ASM 1
#define __PRAGMA_REDEFINE_EXTNAME 1
#define __SIZEOF_WCHAR_T__ 4
#define __SIZEOF_WINT_T__ 4
#define __SIZEOF_PTRDIFF_T__ 4
#define __mips__ 1
#define _mips 1
#define mips 1
#define __R3000 1
#define __R3000__ 1
#define R3000 1
#define _R3000 1
#define __mips_fpr 32
#define _MIPS_ARCH_MIPS1 1
#define _MIPS_ARCH "mips1"
#define _MIPS_TUNE_MIPS1 1
#define _MIPS_TUNE "mips1"
#define __mips 1
#define _MIPS_ISA _MIPS_ISA_MIPS1
#define _ABIO32 1
#define _MIPS_SIM _ABIO32
#define _MIPS_SZINT 32
#define _MIPS_SZLONG 32
#define _MIPS_SZPTR 32
#define _MIPS_FPSET 16
#define _MIPS_SPFPSET 16
#define __mips_hard_float 1
#define __MIPSEL 1
#define __MIPSEL__ 1
#define MIPSEL 1
#define _MIPSEL 1
#define __mips_abicalls 1
#define _LANGUAGE_C_PLUS_PLUS 1
#define __LANGUAGE_C_PLUS_PLUS 1
#define __LANGUAGE_C_PLUS_PLUS__ 1
#define __gnu_linux__ 1
#define __linux 1
#define __linux__ 1
#define linux 1
#define __unix 1
#define __unix__ 1
#define unix 1
#define _GNU_SOURCE 1
#define __ELF__ 1
# 1 "<command-line>"
#define _GNU_SOURCE 1
# 1 "/dev/null"

Could you also share the logs from the language server and compile_commands.json?

Where can I find log from the language server?

In the meantime I share just one entry from compile_commands.json (they are all the same):

{
  "directory": "/home/xxx",
  "command": "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/bin/mipsel-poky-linux-musl/mipsel-poky-linux-musl-g++   -mel -mabi=32 -mhard-float -march=mips32r2 -mmusl --sysroot=/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl  -D... -I/home/xxx/mydir/aaa -I/home/xxx/mydir/bbb -I...  -fpermissive -g   -std=gnu++98 -o CMakeFiles/[...]/myfile.cpp.o -c /home/xxx/myfile.cpp",
  "file": "/home/xxx/myfile.cpp"
},

Thank you.

@michelleangela
Copy link
Contributor

Thanks for the additional info. The extension should have been able to parse the compiler output. Perhaps the language server logs can provide more clues. You can get logs from the language server from instructions at https://code.visualstudio.com/docs/cpp/enable-logging-cpp#_enable-logging-for-the-language-server.

@gentooise
Copy link
Author

Ah, if you mean C_cpp logging level I already have Debug set in my settings. You can find the logs in my first post :)

@sean-mcmanus
Copy link
Collaborator

Can you provide the logging from C/C++: Log Diagnostics with the current C++ file active?

@sean-mcmanus
Copy link
Collaborator

Are you using a workspace or just a folder? There's a known bug with settings being incorrect: #5134

@gentooise
Copy link
Author

I am using just a folder.

Here is the log of the current C++ file:

C/C++ Log
cpptools/getCodeActions: file:///home/xxx/myfile.h (id: 2)
cpptools/queryTranslationUnitSource: file:///home/xxx/myfile.h (id: 3)
terminating child process: 2167
terminating child process: 2176
Custom configurations received:
  uri: file:///home/xxx/myfile.cpp
  config: {
  "defines": [
    "CA"
  ],
  "standard": "c++98",
  "includePath": [
    "/home/xxx/myinclude",
    "/home/xxx/myinclude2",
    "..."
  ],
  "intelliSenseMode": "gcc-x64",
  "compilerPath": "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/bin/mipsel-poky-linux-musl/mipsel-poky-linux-musl-g++",
  "compilerArgs": [
    "-fpermissive",
    "-g",
    "-std=gnu++98"
  ]
}
cpptools/didChangeCustomConfiguration
textDocument/didOpen: file:///home/xxx/myfile.h
Checking for syntax errors: file:///home/xxx/myfile.h
cpptools/activeDocumentChange: file:///home/xxx/myfile.h
cpptools/textEditorSelectionChange
cpptools/getDocumentSymbols: file:///home/xxx/myfile.h (id: 4)
cpptools/getDocumentSymbols
cpptools/textEditorSelectionChange
sending compilation args for /home/xxx/myfile.cpp
  include: /home/xxx/myinclude
  include: /home/xxx/myinclude2
  include: ...
  include: /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include
  include: /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include-fixed
  define: __STDC__=1
  define: __cplusplus=201103L
  define: __STDC_UTF_16__=1
  define: __STDC_UTF_32__=1
  define: __STDC_HOSTED__=1
  define: __GNUC__=5
  define: __GNUC_MINOR__=4
  define: __GNUC_PATCHLEVEL__=0
  define: __VERSION__="5.4.0"
  define: __ATOMIC_RELAXED=0
  define: __ATOMIC_SEQ_CST=5
  define: __ATOMIC_ACQUIRE=2
  define: __ATOMIC_RELEASE=3
  define: __ATOMIC_ACQ_REL=4
  define: __ATOMIC_CONSUME=1
  define: __pic__=1
  define: __PIC__=1
  define: __FINITE_MATH_ONLY__=0
  define: __SIZEOF_INT__=4
  define: __SIZEOF_LONG__=4
  define: __SIZEOF_LONG_LONG__=8
  define: __SIZEOF_SHORT__=2
  define: __SIZEOF_FLOAT__=4
  define: __SIZEOF_DOUBLE__=8
  define: __SIZEOF_LONG_DOUBLE__=8
  define: __SIZEOF_SIZE_T__=4
  define: __CHAR_BIT__=8
  define: __BIGGEST_ALIGNMENT__=8
  define: __ORDER_LITTLE_ENDIAN__=1234
  define: __ORDER_BIG_ENDIAN__=4321
  define: __ORDER_PDP_ENDIAN__=3412
  define: __BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__
  define: __FLOAT_WORD_ORDER__=__ORDER_LITTLE_ENDIAN__
  define: __SIZEOF_POINTER__=4
  define: __GNUG__=5
  define: __SIZE_TYPE__=unsigned int
  define: __PTRDIFF_TYPE__=int
  define: __WCHAR_TYPE__=int
  define: __WINT_TYPE__=unsigned int
  define: __INTMAX_TYPE__=long long int
  define: __UINTMAX_TYPE__=long long unsigned int
  define: __CHAR16_TYPE__=short unsigned int
  define: __CHAR32_TYPE__=unsigned int
  define: __SIG_ATOMIC_TYPE__=int
  define: __INT8_TYPE__=signed char
  define: __INT16_TYPE__=short int
  define: __INT32_TYPE__=int
  define: __INT64_TYPE__=long long int
  define: __UINT8_TYPE__=unsigned char
  define: __UINT16_TYPE__=short unsigned int
  define: __UINT32_TYPE__=unsigned int
  define: __UINT64_TYPE__=long long unsigned int
  define: __INT_LEAST8_TYPE__=signed char
  define: __INT_LEAST16_TYPE__=short int
  define: __INT_LEAST32_TYPE__=int
  define: __INT_LEAST64_TYPE__=long long int
  define: __UINT_LEAST8_TYPE__=unsigned char
  define: __UINT_LEAST16_TYPE__=short unsigned int
  define: __UINT_LEAST32_TYPE__=unsigned int
  define: __UINT_LEAST64_TYPE__=long long unsigned int
  define: __INT_FAST8_TYPE__=signed char
  define: __INT_FAST16_TYPE__=int
  define: __INT_FAST32_TYPE__=int
  define: __INT_FAST64_TYPE__=long long int
  define: __UINT_FAST8_TYPE__=unsigned char
  define: __UINT_FAST16_TYPE__=unsigned int
  define: __UINT_FAST32_TYPE__=unsigned int
  define: __UINT_FAST64_TYPE__=long long unsigned int
  define: __INTPTR_TYPE__=int
  define: __UINTPTR_TYPE__=unsigned int
  define: __GXX_WEAK__=1
  define: __DEPRECATED=1
  define: __GXX_RTTI=1
  define: __GXX_EXPERIMENTAL_CXX0X__=1
  define: __EXCEPTIONS=1
  define: __GXX_ABI_VERSION=1009
  define: __SCHAR_MAX__=0x7f
  define: __SHRT_MAX__=0x7fff
  define: __INT_MAX__=0x7fffffff
  define: __LONG_MAX__=0x7fffffffL
  define: __LONG_LONG_MAX__=0x7fffffffffffffffLL
  define: __WCHAR_MAX__=0x7fffffff
  define: __WCHAR_MIN__=(-__WCHAR_MAX__ - 1)
  define: __WINT_MAX__=0xffffffffU
  define: __WINT_MIN__=0U
  define: __PTRDIFF_MAX__=0x7fffffff
  define: __SIZE_MAX__=0xffffffffU
  define: __INTMAX_MAX__=0x7fffffffffffffffLL
  define: __INTMAX_C(c)=c ## LL
  define: __UINTMAX_MAX__=0xffffffffffffffffULL
  define: __UINTMAX_C(c)=c ## ULL
  define: __SIG_ATOMIC_MAX__=0x7fffffff
  define: __SIG_ATOMIC_MIN__=(-__SIG_ATOMIC_MAX__ - 1)
  define: __INT8_MAX__=0x7f
  define: __INT16_MAX__=0x7fff
  define: __INT32_MAX__=0x7fffffff
  define: __INT64_MAX__=0x7fffffffffffffffLL
  define: __UINT8_MAX__=0xff
  define: __UINT16_MAX__=0xffff
  define: __UINT32_MAX__=0xffffffffU
  define: __UINT64_MAX__=0xffffffffffffffffULL
  define: __INT_LEAST8_MAX__=0x7f
  define: __INT8_C(c)=c
  define: __INT_LEAST16_MAX__=0x7fff
  define: __INT16_C(c)=c
  define: __INT_LEAST32_MAX__=0x7fffffff
  define: __INT32_C(c)=c
  define: __INT_LEAST64_MAX__=0x7fffffffffffffffLL
  define: __INT64_C(c)=c ## LL
  define: __UINT_LEAST8_MAX__=0xff
  define: __UINT8_C(c)=c
  define: __UINT_LEAST16_MAX__=0xffff
  define: __UINT16_C(c)=c
  define: __UINT_LEAST32_MAX__=0xffffffffU
  define: __UINT32_C(c)=c ## U
  define: __UINT_LEAST64_MAX__=0xffffffffffffffffULL
  define: __UINT64_C(c)=c ## ULL
  define: __INT_FAST8_MAX__=0x7f
  define: __INT_FAST16_MAX__=0x7fffffff
  define: __INT_FAST32_MAX__=0x7fffffff
  define: __INT_FAST64_MAX__=0x7fffffffffffffffLL
  define: __UINT_FAST8_MAX__=0xff
  define: __UINT_FAST16_MAX__=0xffffffffU
  define: __UINT_FAST32_MAX__=0xffffffffU
  define: __UINT_FAST64_MAX__=0xffffffffffffffffULL
  define: __INTPTR_MAX__=0x7fffffff
  define: __UINTPTR_MAX__=0xffffffffU
  define: __GCC_IEC_559=1
  define: __GCC_IEC_559_COMPLEX=1
  define: __FLT_EVAL_METHOD__=0
  define: __DEC_EVAL_METHOD__=2
  define: __FLT_RADIX__=2
  define: __FLT_MANT_DIG__=24
  define: __FLT_DIG__=6
  define: __FLT_MIN_EXP__=(-125)
  define: __FLT_MIN_10_EXP__=(-37)
  define: __FLT_MAX_EXP__=128
  define: __FLT_MAX_10_EXP__=38
  define: __FLT_DECIMAL_DIG__=9
  define: __FLT_MAX__=3.4028234663852886e+38F
  define: __FLT_MIN__=1.1754943508222875e-38F
  define: __FLT_EPSILON__=1.1920928955078125e-7F
  define: __FLT_DENORM_MIN__=1.4012984643248171e-45F
  define: __FLT_HAS_DENORM__=1
  define: __FLT_HAS_INFINITY__=1
  define: __FLT_HAS_QUIET_NAN__=1
  define: __DBL_MANT_DIG__=53
  define: __DBL_DIG__=15
  define: __DBL_MIN_EXP__=(-1021)
  define: __DBL_MIN_10_EXP__=(-307)
  define: __DBL_MAX_EXP__=1024
  define: __DBL_MAX_10_EXP__=308
  define: __DBL_DECIMAL_DIG__=17
  define: __DBL_MAX__=double(1.7976931348623157e+308L)
  define: __DBL_MIN__=double(2.2250738585072014e-308L)
  define: __DBL_EPSILON__=double(2.2204460492503131e-16L)
  define: __DBL_DENORM_MIN__=double(4.9406564584124654e-324L)
  define: __DBL_HAS_DENORM__=1
  define: __DBL_HAS_INFINITY__=1
  define: __DBL_HAS_QUIET_NAN__=1
  define: __LDBL_MANT_DIG__=53
  define: __LDBL_DIG__=15
  define: __LDBL_MIN_EXP__=(-1021)
  define: __LDBL_MIN_10_EXP__=(-307)
  define: __LDBL_MAX_EXP__=1024
  define: __LDBL_MAX_10_EXP__=308
  define: __DECIMAL_DIG__=17
  define: __LDBL_MAX__=1.7976931348623157e+308L
  define: __LDBL_MIN__=2.2250738585072014e-308L
  define: __LDBL_EPSILON__=2.2204460492503131e-16L
  define: __LDBL_DENORM_MIN__=4.9406564584124654e-324L
  define: __LDBL_HAS_DENORM__=1
  define: __LDBL_HAS_INFINITY__=1
  define: __LDBL_HAS_QUIET_NAN__=1
  define: __DEC32_MANT_DIG__=7
  define: __DEC32_MIN_EXP__=(-94)
  define: __DEC32_MAX_EXP__=97
  define: __DEC32_MIN__=1E-95DF
  define: __DEC32_MAX__=9.999999E96DF
  define: __DEC32_EPSILON__=1E-6DF
  define: __DEC32_SUBNORMAL_MIN__=0.000001E-95DF
  define: __DEC64_MANT_DIG__=16
  define: __DEC64_MIN_EXP__=(-382)
  define: __DEC64_MAX_EXP__=385
  define: __DEC64_MIN__=1E-383DD
  define: __DEC64_MAX__=9.999999999999999E384DD
  define: __DEC64_EPSILON__=1E-15DD
  define: __DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD
  define: __DEC128_MANT_DIG__=34
  define: __DEC128_MIN_EXP__=(-6142)
  define: __DEC128_MAX_EXP__=6145
  define: __DEC128_MIN__=1E-6143DL
  define: __DEC128_MAX__=9.999999999999999999999999999999999E6144DL
  define: __DEC128_EPSILON__=1E-33DL
  define: __DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL
  define: __SFRACT_FBIT__=7
  define: __SFRACT_IBIT__=0
  define: __SFRACT_MIN__=(-0.5HR-0.5HR)
  define: __SFRACT_MAX__=0X7FP-7HR
  define: __SFRACT_EPSILON__=0x1P-7HR
  define: __USFRACT_FBIT__=8
  define: __USFRACT_IBIT__=0
  define: __USFRACT_MIN__=0.0UHR
  define: __USFRACT_MAX__=0XFFP-8UHR
  define: __USFRACT_EPSILON__=0x1P-8UHR
  define: __FRACT_FBIT__=15
  define: __FRACT_IBIT__=0
  define: __FRACT_MIN__=(-0.5R-0.5R)
  define: __FRACT_MAX__=0X7FFFP-15R
  define: __FRACT_EPSILON__=0x1P-15R
  define: __UFRACT_FBIT__=16
  define: __UFRACT_IBIT__=0
  define: __UFRACT_MIN__=0.0UR
  define: __UFRACT_MAX__=0XFFFFP-16UR
  define: __UFRACT_EPSILON__=0x1P-16UR
  define: __LFRACT_FBIT__=31
  define: __LFRACT_IBIT__=0
  define: __LFRACT_MIN__=(-0.5LR-0.5LR)
  define: __LFRACT_MAX__=0X7FFFFFFFP-31LR
  define: __LFRACT_EPSILON__=0x1P-31LR
  define: __ULFRACT_FBIT__=32
  define: __ULFRACT_IBIT__=0
  define: __ULFRACT_MIN__=0.0ULR
  define: __ULFRACT_MAX__=0XFFFFFFFFP-32ULR
  define: __ULFRACT_EPSILON__=0x1P-32ULR
  define: __LLFRACT_FBIT__=63
  define: __LLFRACT_IBIT__=0
  define: __LLFRACT_MIN__=(-0.5LLR-0.5LLR)
  define: __LLFRACT_MAX__=0X7FFFFFFFFFFFFFFFP-63LLR
  define: __LLFRACT_EPSILON__=0x1P-63LLR
  define: __ULLFRACT_FBIT__=64
  define: __ULLFRACT_IBIT__=0
  define: __ULLFRACT_MIN__=0.0ULLR
  define: __ULLFRACT_MAX__=0XFFFFFFFFFFFFFFFFP-64ULLR
  define: __ULLFRACT_EPSILON__=0x1P-64ULLR
  define: __SACCUM_FBIT__=7
  define: __SACCUM_IBIT__=8
  define: __SACCUM_MIN__=(-0X1P7HK-0X1P7HK)
  define: __SACCUM_MAX__=0X7FFFP-7HK
  define: __SACCUM_EPSILON__=0x1P-7HK
  define: __USACCUM_FBIT__=8
  define: __USACCUM_IBIT__=8
  define: __USACCUM_MIN__=0.0UHK
  define: __USACCUM_MAX__=0XFFFFP-8UHK
  define: __USACCUM_EPSILON__=0x1P-8UHK
  define: __ACCUM_FBIT__=15
  define: __ACCUM_IBIT__=16
  define: __ACCUM_MIN__=(-0X1P15K-0X1P15K)
  define: __ACCUM_MAX__=0X7FFFFFFFP-15K
  define: __ACCUM_EPSILON__=0x1P-15K
  define: __UACCUM_FBIT__=16
  define: __UACCUM_IBIT__=16
  define: __UACCUM_MIN__=0.0UK
  define: __UACCUM_MAX__=0XFFFFFFFFP-16UK
  define: __UACCUM_EPSILON__=0x1P-16UK
  define: __LACCUM_FBIT__=31
  define: __LACCUM_IBIT__=32
  define: __LACCUM_MIN__=(-0X1P31LK-0X1P31LK)
  define: __LACCUM_MAX__=0X7FFFFFFFFFFFFFFFP-31LK
  define: __LACCUM_EPSILON__=0x1P-31LK
  define: __ULACCUM_FBIT__=32
  define: __ULACCUM_IBIT__=32
  define: __ULACCUM_MIN__=0.0ULK
  define: __ULACCUM_MAX__=0XFFFFFFFFFFFFFFFFP-32ULK
  define: __ULACCUM_EPSILON__=0x1P-32ULK
  define: __LLACCUM_FBIT__=31
  define: __LLACCUM_IBIT__=32
  define: __LLACCUM_MIN__=(-0X1P31LLK-0X1P31LLK)
  define: __LLACCUM_MAX__=0X7FFFFFFFFFFFFFFFP-31LLK
  define: __LLACCUM_EPSILON__=0x1P-31LLK
  define: __ULLACCUM_FBIT__=32
  define: __ULLACCUM_IBIT__=32
  define: __ULLACCUM_MIN__=0.0ULLK
  define: __ULLACCUM_MAX__=0XFFFFFFFFFFFFFFFFP-32ULLK
  define: __ULLACCUM_EPSILON__=0x1P-32ULLK
  define: __QQ_FBIT__=7
  define: __QQ_IBIT__=0
  define: __HQ_FBIT__=15
  define: __HQ_IBIT__=0
  define: __SQ_FBIT__=31
  define: __SQ_IBIT__=0
  define: __DQ_FBIT__=63
  define: __DQ_IBIT__=0
  define: __TQ_FBIT__=127
  define: __TQ_IBIT__=0
  define: __UQQ_FBIT__=8
  define: __UQQ_IBIT__=0
  define: __UHQ_FBIT__=16
  define: __UHQ_IBIT__=0
  define: __USQ_FBIT__=32
  define: __USQ_IBIT__=0
  define: __UDQ_FBIT__=64
  define: __UDQ_IBIT__=0
  define: __UTQ_FBIT__=128
  define: __UTQ_IBIT__=0
  define: __HA_FBIT__=7
  define: __HA_IBIT__=8
  define: __SA_FBIT__=15
  define: __SA_IBIT__=16
  define: __DA_FBIT__=31
  define: __DA_IBIT__=32
  define: __TA_FBIT__=63
  define: __TA_IBIT__=64
  define: __UHA_FBIT__=8
  define: __UHA_IBIT__=8
  define: __USA_FBIT__=16
  define: __USA_IBIT__=16
  define: __UDA_FBIT__=32
  define: __UDA_IBIT__=32
  define: __UTA_FBIT__=64
  define: __UTA_IBIT__=64
  define: __REGISTER_PREFIX__=$
  define: __USER_LABEL_PREFIX__=
  define: __GNUC_STDC_INLINE__=1
  define: __NO_INLINE__=1
  define: __STRICT_ANSI__=1
  define: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1=1
  define: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2=1
  define: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1
  define: __GCC_ATOMIC_BOOL_LOCK_FREE=2
  define: __GCC_ATOMIC_CHAR_LOCK_FREE=2
  define: __GCC_ATOMIC_CHAR16_T_LOCK_FREE=2
  define: __GCC_ATOMIC_CHAR32_T_LOCK_FREE=2
  define: __GCC_ATOMIC_WCHAR_T_LOCK_FREE=2
  define: __GCC_ATOMIC_SHORT_LOCK_FREE=2
  define: __GCC_ATOMIC_INT_LOCK_FREE=2
  define: __GCC_ATOMIC_LONG_LOCK_FREE=2
  define: __GCC_ATOMIC_LLONG_LOCK_FREE=1
  define: __GCC_ATOMIC_TEST_AND_SET_TRUEVAL=1
  define: __GCC_ATOMIC_POINTER_LOCK_FREE=2
  define: __GCC_HAVE_DWARF2_CFI_ASM=1
  define: __PRAGMA_REDEFINE_EXTNAME=1
  define: __SIZEOF_WCHAR_T__=4
  define: __SIZEOF_WINT_T__=4
  define: __SIZEOF_PTRDIFF_T__=4
  define: __mips__=1
  define: _mips=1
  define: __R3000=1
  define: __R3000__=1
  define: _R3000=1
  define: __mips_fpr=32
  define: _MIPS_ARCH_MIPS1=1
  define: _MIPS_ARCH="mips1"
  define: _MIPS_TUNE_MIPS1=1
  define: _MIPS_TUNE="mips1"
  define: __mips=1
  define: _MIPS_ISA=_MIPS_ISA_MIPS1
  define: _ABIO32=1
  define: _MIPS_SIM=_ABIO32
  define: _MIPS_SZINT=32
  define: _MIPS_SZLONG=32
  define: _MIPS_SZPTR=32
  define: _MIPS_FPSET=16
  define: _MIPS_SPFPSET=16
  define: __mips_hard_float=1
  define: __MIPSEL=1
  define: __MIPSEL__=1
  define: _MIPSEL=1
  define: __mips_abicalls=1
  define: _LANGUAGE_C_PLUS_PLUS=1
  define: __LANGUAGE_C_PLUS_PLUS=1
  define: __LANGUAGE_C_PLUS_PLUS__=1
  define: __gnu_linux__=1
  define: __linux=1
  define: __linux__=1
  define: __unix=1
  define: __unix__=1
  define: _GNU_SOURCE=1
  define: __ELF__=1
  define: _GNU_SOURCE=1
  define: CA
  other: --g++
  other: --gnu_version=50400
  stdver: c++98
  intelliSenseMode: gcc-x64
Queueing IntelliSense update for files in translation unit of: /home/xxx/myfile.cpp
cpptools/cpptools_finishUpdateSquiggles
Error squiggle count: 7
Error squiggles will be disabled in: file:///home/xxx/myfile.h
terminating child process: 2189
Update IntelliSense time (sec): 0.345
idle loop: reparsing the active document
Checking for syntax errors: file:///home/xxx/myfile.h
Queueing IntelliSense update for files in translation unit of: /home/xxx/myfile.cpp
cpptools/cpptools_finishUpdateSquiggles
Error squiggle count: 7
Update IntelliSense time (sec): 0.27
textDocument/hover: file:///home/xxx/myfile.h (id: 5)

When I go over an include with the squiggle (see screenshots in the first post), I see the following log:
1 include path suggestion(s) discovered.

When I Ctrl-click on the include, the correct file is opened (see always screenshot in the first post).

@gentooise
Copy link
Author

gentooise commented Mar 17, 2020

I add another screen of the entire stdint.h (which could be the root cause of the issue):

image

Could it be some issue with #include_next?

@gentooise
Copy link
Author

gentooise commented Mar 17, 2020

UPDATE: I see that if I Ctrl-click on <stdint.h> again (inside stdint.h itself, see screen above), VSCode remains into the same file. So it seems the plugin did not properly recognize the #include_next directive.

By looking into the filesystem, I think that the correct stdint.h file is placed into:

/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include

where the path:

/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl

is exactly what I see into compile_commands.json as sysroot argument:

--sysroot=/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl

I'm not sure if all these infos are somehow useful.

@michelleangela
Copy link
Contributor

@gentooise
Thanks for providing more info, and sorry for missing the logs in the first post.

The #include_next is the root cause and is a known issue reported at #3969.

Could you try the following workaround? Try to add the path of stdint.h to includePath in c_cpp_properties,json. The extension will use compile_commands.json to determine the include paths (see doc here) if it can create a TU with the values provided by the compile_commands.json. So I suggest to remove compile_commands.json and manually set includePath with the required include paths, for example:

"includePath": [
                "/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include",
                "/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/**",
                "${workspaceRoot}/**"
            ],

Note: the order of the non-recursive paths matters

@michelleangela
Copy link
Contributor

Update on root cause:

I see from the logs that the sysroot path /opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/ is not indexed, so the bug is also from the known issue that sysroot is not parsed from compile_commands.json (#1575).

You can try adding /opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/ to includePath and see if that works without /opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include.

@michelleangela michelleangela added bug Feature: Compile Commands Feature: Configuration An issue related to configuring the extension or IntelliSense and removed more info needed The issue report is not actionable in its current state labels Mar 17, 2020
@michelleangela michelleangela added this to the Triage milestone Mar 17, 2020
@gentooise gentooise changed the title Errors shown on includes from g++ cross-compiler Errors shown on includes from MIPS g++ cross-compiler Mar 19, 2020
@gentooise
Copy link
Author

gentooise commented Mar 19, 2020

Thank you for the support.

Premise: I need to use compile_commands.json for other reasons, but I can disable it for now just to test the include paths. Then I need to make it all work with compile_commands.json, but that could be a next step.

I did a first try with this configuration:

{
    "C_Cpp.loggingLevel": "Debug",
    "C_Cpp.updateChannel": "Insiders",
    "C_Cpp.default.cStandard": "c99",
    "C_Cpp.default.cppStandard": "c++03",
    "C_Cpp.default.intelliSenseMode": "gcc-x86",
    "C_Cpp.default.configurationProvider": "vector-of-bool.cmake-tools",
    "C_Cpp.default.compilerPath": "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/bin/mipsel-poky-linux-musl/mipsel-poky-linux-musl-g++",
    "C_Cpp.default.includePath": [
        "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include",
        "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include-fixed",
	"/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include",
	"${workspaceRoot}/**"
    ],
}

I see this when I open myfile.cpp:

sending compilation args for /home/xxx/myfile.cpp
  include: /opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include
  include: /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include
  include: /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include-fixed
...

(i.e. the paths are in the wrong order anyway). I suspect that the last two includes come from the query to the compiler (from compilerPath).

The same happens if I remove the first two includes:

{
...
    "C_Cpp.default.includePath": [
	"/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include",
	"${workspaceRoot}/**"
    ],
}

In any case the error squiggles disappear, but with this configuration I could potentially have other issues in the future, because it seems I can't control the order of the includes.
Also the ${workspaceRoot}/** part does not work very well for me, because in the workspace I have file with the same name but in different sub-folders, and I would need to control all of them explicitly into the includePath (which is a maintenance mess).

So I did a second try with this configuration:

{
    "C_Cpp.loggingLevel": "Debug",
    "C_Cpp.updateChannel": "Insiders",
    "C_Cpp.default.cStandard": "c99",
    "C_Cpp.default.cppStandard": "c++03",
    "C_Cpp.default.intelliSenseMode": "gcc-x86",
    "C_Cpp.default.configurationProvider": "vector-of-bool.cmake-tools",
    "C_Cpp.default.systemIncludePath": [
        "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include",
        "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include-fixed",
	"/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include"
    ],
    "C_Cpp.default.compilerPath": "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/bin/mipsel-poky-linux-musl/mipsel-poky-linux-musl-g++",
}

And this seems to work better (but not totally), because I can see this in the log:

sending compilation args for /home/xxx/myfile.cpp
  include: /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include
  include: /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include-fixed
  include: /opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include
...

I say not totally because now when I Ctrl-click on #include <stdint.h> I see these 4 choices (but they seem out of order and in any case VSCode does not choose the first one):
image

Also, when I navigate inside the last choice (the correct one) and then I Ctrl-click on #include_next <stdint.h> VSCode is still not able to open the correct stdint.h (the one into sysroot path), but remains on the same file.

Please tell me if I'm doing something wrong or if you need some more details.

@sean-mcmanus
Copy link
Collaborator

Go to Def on #include doesn't hook into IntelliSense, so it will show all the files with the same name, which is bug #2564 . You could potentially work around this via adding paths to files.exclude that you don't want to appear in Go to Definition results.

So you appear to be setup good.

@gentooise
Copy link
Author

gentooise commented Mar 20, 2020

Go to Def on #include doesn't hook into IntelliSense, so it will show all the files with the same name, which is bug #2564 . You could potentially work around this via adding paths to files.exclude that you don't want to appear in Go to Definition results.

Thank you! Didn't know of this existing issue. For now I think I can survive with it (as long as I know which is the correct included file) :)

So you appear to be setup good.

Yes, for me is ok I think, thanks.

Only the following potential issues remain (don't know if you want to track them):

  1. the fact that the order specified into includePath (or systemIncludePath) is not respected:
-------------------- Settings ----------------------
    "C_Cpp.default.includePath": [
        "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include",
        "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include-fixed",
	"/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include",
	"${workspaceRoot}/**"
    ],

or

    "C_Cpp.default.systemIncludePath": [
        "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include",
        "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include-fixed",
	"/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include"
    ],

-------------------- Log ----------------------
sending compilation args for /home/xxx/myfile.cpp
  include: /opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include
  include: /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include
  include: /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include-fixed
...

for now this does not seem to cause particular issues with stdint.h, but it potentially could with other standard includes.

  1. cpptools still seems to fail querying the compiler (apparently there is no effect, don't if should be considered a bug):
Attempting to get defaults from compiler in "compilerPath" property: '/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/bin/mipsel-poky-linux-musl/mipsel-poky-linux-musl-g++'
Compiler does not support 32-bit. Falling back to 64-bit intelliSenseMode.
terminating child process: 1322
Failed to query compiler. Falling back to no bitness.
terminating child process: 1323
terminating child process: 1324
Code browsing service initialized
Attempting to get defaults from compiler in "compilerPath" property: '/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/bin/mipsel-poky-linux-musl/mipsel-poky-linux-musl-g++'
Compiler does not support 32-bit. Falling back to 64-bit intelliSenseMode.
terminating child process: 1326
Failed to query compiler. Falling back to no bitness.
terminating child process: 1327
terminating child process: 1328

@gentooise
Copy link
Author

gentooise commented Mar 20, 2020

UPDATE: I found another issue (with the same configuration and all).

image

Basically I see strange errors on C++ standard includes, and if I go down in the includes (Go to Def), all comes down to this:

image

But both os_defines.h and cpu_defines.h are extremely simple files (btw Go to Def works when I open them):

image

image

sending compilation args for /opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include/c++/5.4.0/mipsel-poky-linux-musl/bits/c++config.h
  include: /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include
  include: /opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include-fixed
  include: /opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include
...

It is very strange :/

UPDATE2: I found the issue, there were other two paths missing from systemIncludePath:

    "C_Cpp.default.systemIncludePath": [
        "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include",
        "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include-fixed",
        "/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include",
        "/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include/c++/5.4.0",
        "/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include/c++/5.4.0/mipsel-poky-linux-musl"
    ],

Or may I use this?

    "C_Cpp.default.systemIncludePath": [
        "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include",
        "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include-fixed",
        "/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include/**"
    ],

Both work for now, I think the only difference is if I want to select only specific folders and/or decide their relative ordering :)

So, only the open points in my previous comment remain.

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Mar 21, 2020

Is your compilerPath set to ""?

The system includes can get reordered if they match system includes returned by the queried compiler.

Usage of "**" with system include path is not recommended because "**" generates the paths an non-deterministic order.

@gentooise
Copy link
Author

gentooise commented Mar 23, 2020

My configuration is this one now:

{
    "C_Cpp.loggingLevel": "Debug",
    "C_Cpp.updateChannel": "Insiders",
    "C_Cpp.default.cStandard": "c99",
    "C_Cpp.default.cppStandard": "c++03",
    "C_Cpp.default.intelliSenseMode": "gcc-x86",
    "C_Cpp.default.configurationProvider": "vector-of-bool.cmake-tools",
    "C_Cpp.default.systemIncludePath": [
        "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include",
        "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/lib/mipsel-poky-linux/gcc/mipsel-poky-linux/5.4.0/include-fixed",
        "/opt/dl-distro-tiny/2.2.4/sysroots/mips32r2el-poky-linux-musl/usr/include/**"
    ],
    "C_Cpp.default.compilerPath": "/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/bin/mipsel-poky-linux-musl/mipsel-poky-linux-musl-g++",
}

@sean-mcmanus
Copy link
Collaborator

Is that configuration working for you? If not, what's the issue? Is there still unwanted includePath reordering occurring?

@gentooise
Copy link
Author

gentooise commented Apr 2, 2020

The problem is that the situation is not quite repeatable... include error squiggles sometimes come back.

Also, even if I set "C_Cpp.default.compilerPath": "",, I still see this in the log:

Attempting to get defaults from compiler in "compilerPath" property: '/opt/dl-distro-tiny/2.2.4/sysroots/x86_64-pokysdk-linux/usr/bin/mipsel-poky-linux-musl/mipsel-poky-linux-musl-g++'

Is it possible that the compilerPath is filled in by CMake Tools anyway? @sean-mcmanus

Anyway, it seems that no include reordering occurs now, both with and without compilerPath.
I'm not able to report other information because everything seems a bit nondeterministic.

@sean-mcmanus
Copy link
Collaborator

Yes, CMake Tools will send us a compilerPath as part of the info we receive from them. You can see that data in the logging after "Custom configurations received".

@Colengms
Copy link
Collaborator

Colengms commented Nov 5, 2020

@gentooise Are you still seeing this issue? Some improvements have been made since you opened the issue. Using the latest version (currently 1.1.0-insiders4), there should be more detail in the log regarding compiler probing and configuration.

@Colengms Colengms added the more info needed The issue report is not actionable in its current state label Nov 5, 2020
@Colengms Colengms self-assigned this Nov 5, 2020
@github-actions
Copy link

github-actions bot commented Jan 4, 2021

This issue has been closed automatically because it needs more information and has not had recent activity.

@github-actions github-actions bot closed this as completed Jan 4, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Compile Commands Feature: Configuration An issue related to configuring the extension or IntelliSense Language Service more info needed The issue report is not actionable in its current state
Projects
None yet
Development

No branches or pull requests

4 participants