diff --git a/CHANGELOG.md b/CHANGELOG.md index e05ac8bc..a5964a0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,22 @@ All notable version changes will be recorded in this file. *** +### [v3.23.14] revision + +**New**: + - `Project Templates Explorer`: New online project templates web site: https://templates.em-ide.com + +**Fix**: + - `Task Execution Broken`: Fix build task not work on latest vscode. + - `Symbol Table`: Fix `ENOBUF` when dump symbol table from a big file. + +**Improve**: + - `Project Templates`: Update internal project templates. + - `C/C++`: Update builtin lint headers. + - `Other`: Miscellaneous things. + +*** + ### [v3.23.13] revision **Improve**: diff --git a/package.json b/package.json index 0c2bb66c..8353b3e8 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "homepage": "https://em-ide.com", "license": "MIT", "description": "A mcu development environment for 8051/AVR/STM8/Cortex-M/MIPS/RISC-V", - "version": "3.23.13", + "version": "3.23.14", "preview": false, "engines": { "vscode": "^1.67.0" @@ -377,12 +377,6 @@ "markdownDescription": "%settings.iar.arm.toolchain.install.folder%", "default": "" }, - "EIDE.STM8.GNU-SDCC.InstallDirectory": { - "type": "string", - "scope": "resource", - "markdownDescription": "gnu sdcc for stm8 installation path", - "default": "${userHome}/.eide/tools/stm8_gnu_sdcc" - }, "EIDE.STM8.COSMIC.InstallDirectory": { "type": "string", "scope": "resource", diff --git a/package.nls.json b/package.nls.json index 7ab656fb..02a8b5cc 100644 --- a/package.nls.json +++ b/package.nls.json @@ -173,5 +173,5 @@ "string.eide.open_docs": "Learn More", "string.eide.open_docs.detail": "Click the link will open the home page that may help you learn more about usage.\n[Embedded IDE](https://em-ide.com/)", - "string.eide.project.welcome": "No projects in this workspace !\n[Open Project](command:eide.operation.open_project)\n[Create Project](command:eide.operation.new_project)\n[Import Project](command:eide.operation.import_project)" + "string.eide.project.welcome": "No eide projects in this workspace !\n[Open Project](command:eide.operation.open_project)\n[New Project](command:eide.operation.new_project)\n[Import Project](command:eide.operation.import_project)" } \ No newline at end of file diff --git a/res/data/.clang-format b/res/data/.clang-format index d53e47a0..9a6a19fa 100644 --- a/res/data/.clang-format +++ b/res/data/.clang-format @@ -1,38 +1,20 @@ +# For more options, open this url: https://clang.llvm.net.cn/docs/ClangFormatStyleOptions.html --- BasedOnStyle: Microsoft -Language: C - -################################### -# indent conf -################################### - -UseTab: Never IndentWidth: 4 +UseTab: Never TabWidth: 4 ColumnLimit: 0 +--- +Language: Cpp AccessModifierOffset: -4 NamespaceIndentation: All FixNamespaceComments: false BreakBeforeBraces: Linux - -################################### -# other styles -################################### - -# -# for more conf, you can ref: https://clang.llvm.org/docs/ClangFormatStyleOptions.html -# - AllowShortIfStatementsOnASingleLine: true - AllowShortLoopsOnASingleLine: true - AllowShortBlocksOnASingleLine: true - IndentCaseLabels: true - SortIncludes: false - AlignConsecutiveMacros: AcrossEmptyLines - AlignConsecutiveAssignments: Consecutive diff --git a/res/data/builtin_headers/lint_armcc.h b/res/data/builtin_headers/lint_armcc.h new file mode 100644 index 00000000..16033350 --- /dev/null +++ b/res/data/builtin_headers/lint_armcc.h @@ -0,0 +1,219 @@ +/*** + * !!! Don't include this file in your project !, it can only be used for code analysis !!! +*/ + +#ifndef __VSCODE_CPPTOOL +#error "Don't include this file in your project !, it can only be used for code analysis !" +#endif // ! + +#ifdef _WIN32 +#undef _WIN32 +#endif + +#ifdef _MSC_VER +#undef _MSC_VER +#endif + +#ifdef __GNUC__ +#undef __GNUC__ +#endif + +#define __CC_ARM + +// unofficial defines +// #define volatile + +// keywords +#define __attribute__(x) +#define __nonnull__(x) +#define __builtin_va_arg(x, t) ((t)0) +#define __builtin_va_start(x, p) +#define __builtin_va_end(x) + +#define __swi(x) +#define __align(n) +#define __forceinline +#define __restrict +#define __alignof__(x) sizeof(x) +#define __ALIGNOF__ __alignof__ +#define __asm(x) +#define __global_reg(n) +#define __inline inline +#define __INTADDR__(x) x +#define __irq +#define __packed +#define __pure +#define __smc(x) +#define __softfp +#define __svc(x) +#define __svc_indirect(x) +#define __svc_indirect_r7(x) +#define __value_in_regs +#define __weak +#define __writeonly +#define __declspec(x) +#define __int64 long long +#define __register + +#define __va_arg(ap, type) __builtin_va_arg(ap, type) +#define __va_start(ap, param) __builtin_va_start(ap, param) +#define __va_end(ap) __builtin_va_end(ap) + +#define OS_RUNPRIV 1 +#define __MODULE__ "" + +#ifdef __cplusplus +float __fabs(float val); +#define __ARRAY_OPERATORS +#endif + +#ifndef __arm__ +#define __arm__ +#endif + +#define __EDG__ +#define __sizeof_int 4 +#define __sizeof_long 4 +#define __sizeof_ptr 4 +#define __STDC__ + +// intrinsic function prototypes +void __breakpoint(int val); +void __cdp(unsigned int coproc, unsigned int ops, unsigned int regs); +void __clrex(void); +unsigned char __clz(unsigned int val); +unsigned int __current_pc(void); +unsigned int __current_sp(void); +int __disable_fiq(void); +int __disable_irq(void); +void __enable_fiq(void); +void __enable_irq(void); +double __fabs(double val); +void __force_stores(void); +unsigned int __ldrex(volatile void *ptr); +unsigned long long __ldrexd(volatile void *ptr); +unsigned int __ldrt(const volatile void *ptr); +void __memory_changed(void); +void __nop(void); +//void __pld(...); +//void __pldw(...); +//void __pli(...); +void __promise(unsigned int); +int __qadd(int val1, int val2); +int __qdbl(int val); +int __qsub(int val1, int val2); +unsigned int __rbit(unsigned int val); +unsigned int __rev(unsigned int val); +unsigned int __return_address(void); +unsigned int __ror(unsigned int val, unsigned int shift); +void __schedule_barrier(void); +int __semihost(int val, const void *ptr); +void __sev(void); +double __sqrt(double val); +float __sqrtf(float val); +int __ssat(int val, unsigned int sat); +int __strex(unsigned int val, volatile void *ptr); +int __strexd(unsigned long long val, volatile void *ptr); +void __strt(unsigned int val, volatile void *ptr); +unsigned int __swp(unsigned int val, volatile void *ptr); +int __usat(unsigned int val, unsigned int sat); +void __wfe(void); +void __wfi(void); +void __yield(void); + +void __isb(unsigned int); +void __dsb(unsigned int); +void __dmb(unsigned int); + +void __dci(unsigned bitpatterm); +void __dci_n(unsigned bitpattern); +void __dci_w(unsigned bitpattern); + +// ARMv6 SIMD intrinsics +unsigned int __qadd16(unsigned int val1, unsigned int val2); +unsigned int __qadd8(unsigned int val1, unsigned int val2); +unsigned int __qasx(unsigned int val1, unsigned int val2); +unsigned int __qsax(unsigned int val1, unsigned int val2); +unsigned int __qsub16(unsigned int val1, unsigned int val2); +unsigned int __qsub8(unsigned int val1, unsigned int val2); +unsigned int __sadd16(unsigned int val1, unsigned int val2); +unsigned int __sadd8(unsigned int val1, unsigned int val2); +unsigned int __sasx(unsigned int val1, unsigned int val2); +unsigned int __sel(unsigned int val1, unsigned int val2); +unsigned int __shadd16(unsigned int val1, unsigned int val2); +unsigned int __shadd8(unsigned int val1, unsigned int val2); +unsigned int __shasx(unsigned int val1, unsigned int val2); +unsigned int __shsax(unsigned int val1, unsigned int val2); +unsigned int __shsub16(unsigned int val1, unsigned int val2); +unsigned int __shsub8(unsigned int val1, unsigned int val2); +unsigned int __smlad(unsigned int val1, unsigned int val2, unsigned int val3); +unsigned int __smladx(unsigned int val1, unsigned int val2, unsigned int val3); +unsigned long long __smlald(unsigned int val1, unsigned int val2, unsigned long long val3); +unsigned long long __smlaldx(unsigned int val1, unsigned int val2, unsigned long long val3); +unsigned int __smlsd(unsigned int val1, unsigned int val2, unsigned int val3); +unsigned int __smlsdx(unsigned int val1, unsigned int val2, unsigned int val3); +unsigned long long __smlsld(unsigned int val1, unsigned int val2, unsigned long long val3); +unsigned long long __smlsldx(unsigned int val1, unsigned int val2, unsigned long long val3); +unsigned int __smuad(unsigned int val1, unsigned int val2); +unsigned int __smuadx(unsigned int val1, unsigned int val2); +unsigned int __smusd(unsigned int val1, unsigned int val2); +unsigned int __smusdx(unsigned int val1, unsigned int val2); +unsigned int __saturate_halfwords(unsigned int val1, unsigned int val2); +unsigned int __ssax(unsigned int val1, unsigned int val2); +unsigned int __ssub16(unsigned int val1, unsigned int val2); +unsigned int __ssub8(unsigned int val1, unsigned int val2); +unsigned int __sxtab16(unsigned int val1, unsigned int val2); +unsigned int __sxtb16(unsigned int val); +unsigned int __uadd16(unsigned int val1, unsigned int val2); +unsigned int __uadd8(unsigned int val1, unsigned int val2); +unsigned int __uasx(unsigned int val1, unsigned int val2); +unsigned int __uhadd16(unsigned int val1, unsigned int val2); +unsigned int __uhadd8(unsigned int val1, unsigned int val2); +unsigned int __uhasx(unsigned int val1, unsigned int val2); +unsigned int __uhsax(unsigned int val1, unsigned int val2); +unsigned int __uhsub16(unsigned int val1, unsigned int val2); +unsigned int __uhsub8(unsigned int val1, unsigned int val2); +unsigned int __uqadd16(unsigned int val1, unsigned int val2); +unsigned int __uqadd8(unsigned int val1, unsigned int val2); +unsigned int __uqasx(unsigned int val1, unsigned int val2); +unsigned int __uqsax(unsigned int val1, unsigned int val2); +unsigned int __uqsub16(unsigned int val1, unsigned int val2); +unsigned int __uqsub8(unsigned int val1, unsigned int val2); +unsigned int __usad8(unsigned int val1, unsigned int val2); +unsigned int __usada8(unsigned int val1, unsigned int val2, unsigned int val3); +unsigned int __usax(unsigned int val1, unsigned int val2); +unsigned int __usat16(unsigned int val1, /* constant */ unsigned int val2); +unsigned int __usub16(unsigned int val1, unsigned int val2); +unsigned int __usub8(unsigned int val1, unsigned int val2); +unsigned int __uxtab16(unsigned int val1, unsigned int val2); +unsigned int __uxtb16(unsigned int val); + +// synchronization and barrier intrinsics +void __dbg(void); +int __saturation_occurred(void); +void __set_saturation_occurred(int); +void __ignore_saturation(void); +unsigned int __rev(unsigned int x); +unsigned int __rev16(unsigned int x); +short __revsh(short x); + +// CMSIS embedded assembler functions +unsigned int __REV16(unsigned int x); +int __REVSH(int x); +unsigned int __RRX(unsigned int x); + +// 16-bit multiplications +int __smulbb(int a, int b); +int __smulbt(int a, int b); +int __smultb(int a, int b); +int __smultt(int a, int b); +int __smulwb(int a, int b); +int __smulwt(int a, int b); + +// accumulating multiplication intrinsics +int __smlabb(int a, int b, int c); +int __smlabt(int a, int b, int c); +int __smlatb(int a, int b, int c); +int __smlatt(int a, int b, int c); +int __smlawb(int a, int b, int c); +int __smlawt(int a, int b, int c); diff --git a/res/data/builtin_headers/lint_armclang.h b/res/data/builtin_headers/lint_armclang.h new file mode 100644 index 00000000..6a28b668 --- /dev/null +++ b/res/data/builtin_headers/lint_armclang.h @@ -0,0 +1,433 @@ +/*** + * !!! Don't include this file in your project !, it can only be used for code analysis !!! +*/ + +#ifndef __VSCODE_CPPTOOL +#error "Don't include this file in your project !, it can only be used for code analysis !" +#endif // ! + +#ifdef _WIN32 +#undef _WIN32 +#endif + +#ifdef _MSC_VER +#undef _MSC_VER +#endif + +// internal macros +#define _ILP32 1 +#define _USE_STATIC_INLINE 1 +#define __APCS_32__ 1 +#define __ARMCC_VERSION 6100100 +#define __ARMCOMPILER_VERSION 6100100 +#define __ARMEL__ 1 +#define __ARM_32BIT_STATE 1 +#define __ARM_ACLE 200 +#define __ARM_ARCH 4 +#define __ARM_ARCH_4T__ 1 +#define __ARM_ARCH_ISA_ARM 1 +#define __ARM_ARCH_ISA_THUMB 1 +#define __ARM_EABI__ 1 +#define __ARM_FP16_ARGS 1 +#define __ARM_FP16_FORMAT_IEEE 1 +#define __ARM_NO_IMAGINARY_TYPE 1 +#define __ARM_PCS 1 +#define __ARM_PROMISE __builtin_assume +#define __ARM_SIZEOF_MINIMAL_ENUM 4 +#define __ARM_SIZEOF_WCHAR_T 4 +#define __ARM_TARGET_COPROC 1 +#define __ARM_TARGET_COPROC_V4 1 +#define __ATOMIC_ACQUIRE 2 +#define __ATOMIC_ACQ_REL 4 +#define __ATOMIC_CONSUME 1 +#define __ATOMIC_RELAXED 0 +#define __ATOMIC_RELEASE 3 +#define __ATOMIC_SEQ_CST 5 +#define __BIGGEST_ALIGNMENT__ 8 +#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ +#define __CHAR16_TYPE__ unsigned short +#define __CHAR32_TYPE__ unsigned int +#define __CHAR_BIT__ 8 +#define __CHAR_UNSIGNED__ 1 +#define __CLANG_ATOMIC_BOOL_LOCK_FREE 1 +#define __CLANG_ATOMIC_CHAR16_T_LOCK_FREE 1 +#define __CLANG_ATOMIC_CHAR32_T_LOCK_FREE 1 +#define __CLANG_ATOMIC_CHAR_LOCK_FREE 1 +#define __CLANG_ATOMIC_INT_LOCK_FREE 1 +#define __CLANG_ATOMIC_LLONG_LOCK_FREE 1 +#define __CLANG_ATOMIC_LONG_LOCK_FREE 1 +#define __CLANG_ATOMIC_POINTER_LOCK_FREE 1 +#define __CLANG_ATOMIC_SHORT_LOCK_FREE 1 +#define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 1 +#define __CONSTANT_CFSTRINGS__ 1 +#define __DBL_DECIMAL_DIG__ 17 +#define __DBL_DENORM_MIN__ 4.9406564584124654e-324 +#define __DBL_DIG__ 15 +#define __DBL_EPSILON__ 2.2204460492503131e-16 +#define __DBL_HAS_DENORM__ 1 +#define __DBL_HAS_INFINITY__ 1 +#define __DBL_HAS_QUIET_NAN__ 1 +#define __DBL_MANT_DIG__ 53 +#define __DBL_MAX_10_EXP__ 308 +#define __DBL_MAX_EXP__ 1024 +#define __DBL_MAX__ 1.7976931348623157e+308 +#define __DBL_MIN_10_EXP__ (-307) +#define __DBL_MIN_EXP__ (-1021) +#define __DBL_MIN__ 2.2250738585072014e-308 +#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__ +#define __ELF__ 1 +#define __ESCAPE__ +#define __FINITE_MATH_ONLY__ 1 +#define __FLT16_DECIMAL_DIG__ 5 +#define __FLT16_DENORM_MIN__ 5.9604644775390625e-8F16 +#define __FLT16_DIG__ 3 +#define __FLT16_EPSILON__ 9.765625e-4F16 +#define __FLT16_HAS_DENORM__ 1 +#define __FLT16_HAS_INFINITY__ 1 +#define __FLT16_HAS_QUIET_NAN__ 1 +#define __FLT16_MANT_DIG__ 11 +#define __FLT16_MAX_10_EXP__ 4 +#define __FLT16_MAX_EXP__ 15 +#define __FLT16_MAX__ 6.5504e+4F16 +#define __FLT16_MIN_10_EXP__ (-13) +#define __FLT16_MIN_EXP__ (-14) +#define __FLT16_MIN__ 6.103515625e-5F16 +#define __FLT_DECIMAL_DIG__ 9 +#define __FLT_DENORM_MIN__ 1.40129846e-45F +#define __FLT_DIG__ 6 +#define __FLT_EPSILON__ 1.19209290e-7F +#define __FLT_EVAL_METHOD__ 0 +#define __FLT_HAS_DENORM__ 1 +#define __FLT_HAS_INFINITY__ 1 +#define __FLT_HAS_QUIET_NAN__ 1 +#define __FLT_MANT_DIG__ 24 +#define __FLT_MAX_10_EXP__ 38 +#define __FLT_MAX_EXP__ 128 +#define __FLT_MAX__ 3.40282347e+38F +#define __FLT_MIN_10_EXP__ (-37) +#define __FLT_MIN_EXP__ (-125) +#define __FLT_MIN__ 1.17549435e-38F +#define __FLT_RADIX__ 2 +#define __GCC_ATOMIC_BOOL_LOCK_FREE 1 +#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 1 +#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 1 +#define __GCC_ATOMIC_CHAR_LOCK_FREE 1 +#define __GCC_ATOMIC_INT_LOCK_FREE 1 +#define __GCC_ATOMIC_LLONG_LOCK_FREE 1 +#define __GCC_ATOMIC_LONG_LOCK_FREE 1 +#define __GCC_ATOMIC_POINTER_LOCK_FREE 1 +#define __GCC_ATOMIC_SHORT_LOCK_FREE 1 +#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1 +#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 1 +#define __GNUC_MINOR__ 2 +#define __GNUC_PATCHLEVEL__ 1 +#define __GNUC_STDC_INLINE__ 1 +#define __GNUC__ 4 +#define __GXX_ABI_VERSION 1002 +#define __ILP32__ 1 +#define __INT16_C_SUFFIX__ +#define __INT16_FMTd__ "hd" +#define __INT16_FMTi__ "hi" +#define __INT16_MAX__ 32767 +#define __INT16_TYPE__ short +#define __INT32_C_SUFFIX__ +#define __INT32_FMTd__ "d" +#define __INT32_FMTi__ "i" +#define __INT32_MAX__ 2147483647 +#define __INT32_TYPE__ int +#define __INT64_C_SUFFIX__ LL +#define __INT64_FMTd__ "lld" +#define __INT64_FMTi__ "lli" +#define __INT64_MAX__ 9223372036854775807LL +#define __INT64_TYPE__ long long int +#define __INT8_C_SUFFIX__ +#define __INT8_FMTd__ "hhd" +#define __INT8_FMTi__ "hhi" +#define __INT8_MAX__ 127 +#define __INT8_TYPE__ signed char +#define __INTMAX_C_SUFFIX__ LL +#define __INTMAX_FMTd__ "lld" +#define __INTMAX_FMTi__ "lli" +#define __INTMAX_MAX__ 9223372036854775807LL +#define __INTMAX_TYPE__ long long int +#define __INTMAX_WIDTH__ 64 +#define __INTPTR_FMTd__ "d" +#define __INTPTR_FMTi__ "i" +#define __INTPTR_MAX__ 2147483647 +#define __INTPTR_TYPE__ int +#define __INTPTR_WIDTH__ 32 +#define __INT_FAST16_FMTd__ "hd" +#define __INT_FAST16_FMTi__ "hi" +#define __INT_FAST16_MAX__ 32767 +#define __INT_FAST16_TYPE__ short +#define __INT_FAST32_FMTd__ "d" +#define __INT_FAST32_FMTi__ "i" +#define __INT_FAST32_MAX__ 2147483647 +#define __INT_FAST32_TYPE__ int +#define __INT_FAST64_FMTd__ "lld" +#define __INT_FAST64_FMTi__ "lli" +#define __INT_FAST64_MAX__ 9223372036854775807LL +#define __INT_FAST64_TYPE__ long long int +#define __INT_FAST8_FMTd__ "hhd" +#define __INT_FAST8_FMTi__ "hhi" +#define __INT_FAST8_MAX__ 127 +#define __INT_FAST8_TYPE__ signed char +#define __INT_LEAST16_FMTd__ "hd" +#define __INT_LEAST16_FMTi__ "hi" +#define __INT_LEAST16_MAX__ 32767 +#define __INT_LEAST16_TYPE__ short +#define __INT_LEAST32_FMTd__ "d" +#define __INT_LEAST32_FMTi__ "i" +#define __INT_LEAST32_MAX__ 2147483647 +#define __INT_LEAST32_TYPE__ int +#define __INT_LEAST64_FMTd__ "lld" +#define __INT_LEAST64_FMTi__ "lli" +#define __INT_LEAST64_MAX__ 9223372036854775807LL +#define __INT_LEAST64_TYPE__ long long int +#define __INT_LEAST8_FMTd__ "hhd" +#define __INT_LEAST8_FMTi__ "hhi" +#define __INT_LEAST8_MAX__ 127 +#define __INT_LEAST8_TYPE__ signed char +#define __INT_MAX__ 2147483647 +#define __I__ 1.0if +#define __LDBL_DECIMAL_DIG__ 17 +#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L +#define __LDBL_DIG__ 15 +#define __LDBL_EPSILON__ 2.2204460492503131e-16L +#define __LDBL_HAS_DENORM__ 1 +#define __LDBL_HAS_INFINITY__ 1 +#define __LDBL_HAS_QUIET_NAN__ 1 +#define __LDBL_MANT_DIG__ 53 +#define __LDBL_MAX_10_EXP__ 308 +#define __LDBL_MAX_EXP__ 1024 +#define __LDBL_MAX__ 1.7976931348623157e+308L +#define __LDBL_MIN_10_EXP__ (-307) +#define __LDBL_MIN_EXP__ (-1021) +#define __LDBL_MIN__ 2.2250738585072014e-308L +#define __LITTLE_ENDIAN__ 1 +#define __LONG_LONG_MAX__ 9223372036854775807LL +#define __LONG_MAX__ 2147483647L +#define __NO_INLINE__ 1 +#define __OBJC_BOOL_IS_BOOL 0 +#define __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES 3 +#define __OPENCL_MEMORY_SCOPE_DEVICE 2 +#define __OPENCL_MEMORY_SCOPE_SUB_GROUP 4 +#define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1 +#define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0 +#define __ORDER_BIG_ENDIAN__ 4321 +#define __ORDER_LITTLE_ENDIAN__ 1234 +#define __ORDER_PDP_ENDIAN__ 3412 +#define __POINTER_WIDTH__ 32 +#define __PRAGMA_REDEFINE_EXTNAME 1 +#define __PTRDIFF_FMTd__ "d" +#define __PTRDIFF_FMTi__ "i" +#define __PTRDIFF_MAX__ 2147483647 +#define __PTRDIFF_TYPE__ int +#define __PTRDIFF_WIDTH__ 32 +#define __REGISTER_PREFIX__ +#define __SCHAR_MAX__ 127 +#define __SHRT_MAX__ 32767 +#define __SIG_ATOMIC_MAX__ 2147483647 +#define __SIG_ATOMIC_WIDTH__ 32 +#define __SIZEOF_DOUBLE__ 8 +#define __SIZEOF_FLOAT__ 4 +#define __SIZEOF_INT__ 4 +#define __SIZEOF_LONG_DOUBLE__ 8 +#define __SIZEOF_LONG_LONG__ 8 +#define __SIZEOF_LONG__ 4 +#define __SIZEOF_POINTER__ 4 +#define __SIZEOF_PTRDIFF_T__ 4 +#define __SIZEOF_SHORT__ 2 +#define __SIZEOF_SIZE_T__ 4 +#define __SIZEOF_WCHAR_T__ 4 +#define __SIZEOF_WINT_T__ 4 +#define __SIZE_FMTX__ "X" +#define __SIZE_FMTo__ "o" +#define __SIZE_FMTu__ "u" +#define __SIZE_FMTx__ "x" +#define __SIZE_MAX__ 4294967295U +#define __SIZE_TYPE__ unsigned int +#define __SIZE_WIDTH__ 32 +#define __STDC_HOSTED__ 1 +#define __STDC_UTF_16__ 1 +#define __STDC_UTF_32__ 1 +#define __STDC_VERSION__ 201112L +#define __STDC__ 1 +#define __UINT16_C_SUFFIX__ +#define __UINT16_FMTX__ "hX" +#define __UINT16_FMTo__ "ho" +#define __UINT16_FMTu__ "hu" +#define __UINT16_FMTx__ "hx" +#define __UINT16_MAX__ 65535 +#define __UINT16_TYPE__ unsigned short +#define __UINT32_C_SUFFIX__ U +#define __UINT32_FMTX__ "X" +#define __UINT32_FMTo__ "o" +#define __UINT32_FMTu__ "u" +#define __UINT32_FMTx__ "x" +#define __UINT32_MAX__ 4294967295U +#define __UINT32_TYPE__ unsigned int +#define __UINT64_C_SUFFIX__ ULL +#define __UINT64_FMTX__ "llX" +#define __UINT64_FMTo__ "llo" +#define __UINT64_FMTu__ "llu" +#define __UINT64_FMTx__ "llx" +#define __UINT64_MAX__ 18446744073709551615ULL +#define __UINT64_TYPE__ long long unsigned int +#define __UINT8_C_SUFFIX__ +#define __UINT8_FMTX__ "hhX" +#define __UINT8_FMTo__ "hho" +#define __UINT8_FMTu__ "hhu" +#define __UINT8_FMTx__ "hhx" +#define __UINT8_MAX__ 255 +#define __UINT8_TYPE__ unsigned char +#define __UINTMAX_C_SUFFIX__ ULL +#define __UINTMAX_FMTX__ "llX" +#define __UINTMAX_FMTo__ "llo" +#define __UINTMAX_FMTu__ "llu" +#define __UINTMAX_FMTx__ "llx" +#define __UINTMAX_MAX__ 18446744073709551615ULL +#define __UINTMAX_TYPE__ long long unsigned int +#define __UINTMAX_WIDTH__ 64 +#define __UINTPTR_FMTX__ "X" +#define __UINTPTR_FMTo__ "o" +#define __UINTPTR_FMTu__ "u" +#define __UINTPTR_FMTx__ "x" +#define __UINTPTR_MAX__ 4294967295U +#define __UINTPTR_TYPE__ unsigned int +#define __UINTPTR_WIDTH__ 32 +#define __UINT_FAST16_FMTX__ "hX" +#define __UINT_FAST16_FMTo__ "ho" +#define __UINT_FAST16_FMTu__ "hu" +#define __UINT_FAST16_FMTx__ "hx" +#define __UINT_FAST16_MAX__ 65535 +#define __UINT_FAST16_TYPE__ unsigned short +#define __UINT_FAST32_FMTX__ "X" +#define __UINT_FAST32_FMTo__ "o" +#define __UINT_FAST32_FMTu__ "u" +#define __UINT_FAST32_FMTx__ "x" +#define __UINT_FAST32_MAX__ 4294967295U +#define __UINT_FAST32_TYPE__ unsigned int +#define __UINT_FAST64_FMTX__ "llX" +#define __UINT_FAST64_FMTo__ "llo" +#define __UINT_FAST64_FMTu__ "llu" +#define __UINT_FAST64_FMTx__ "llx" +#define __UINT_FAST64_MAX__ 18446744073709551615ULL +#define __UINT_FAST64_TYPE__ long long unsigned int +#define __UINT_FAST8_FMTX__ "hhX" +#define __UINT_FAST8_FMTo__ "hho" +#define __UINT_FAST8_FMTu__ "hhu" +#define __UINT_FAST8_FMTx__ "hhx" +#define __UINT_FAST8_MAX__ 255 +#define __UINT_FAST8_TYPE__ unsigned char +#define __UINT_LEAST16_FMTX__ "hX" +#define __UINT_LEAST16_FMTo__ "ho" +#define __UINT_LEAST16_FMTu__ "hu" +#define __UINT_LEAST16_FMTx__ "hx" +#define __UINT_LEAST16_MAX__ 65535 +#define __UINT_LEAST16_TYPE__ unsigned short +#define __UINT_LEAST32_FMTX__ "X" +#define __UINT_LEAST32_FMTo__ "o" +#define __UINT_LEAST32_FMTu__ "u" +#define __UINT_LEAST32_FMTx__ "x" +#define __UINT_LEAST32_MAX__ 4294967295U +#define __UINT_LEAST32_TYPE__ unsigned int +#define __UINT_LEAST64_FMTX__ "llX" +#define __UINT_LEAST64_FMTo__ "llo" +#define __UINT_LEAST64_FMTu__ "llu" +#define __UINT_LEAST64_FMTx__ "llx" +#define __UINT_LEAST64_MAX__ 18446744073709551615ULL +#define __UINT_LEAST64_TYPE__ long long unsigned int +#define __UINT_LEAST8_FMTX__ "hhX" +#define __UINT_LEAST8_FMTo__ "hho" +#define __UINT_LEAST8_FMTu__ "hhu" +#define __UINT_LEAST8_FMTx__ "hhx" +#define __UINT_LEAST8_MAX__ 255 +#define __UINT_LEAST8_TYPE__ unsigned char +#define __USER_LABEL_PREFIX__ +#define __VERSION__ "4.2.1 Compatible Clang 7.0.0 " +#define __WCHAR_MAX__ 4294967295U +#define __WCHAR_TYPE__ unsigned int +#define __WCHAR_UNSIGNED__ 1 +#define __WCHAR_WIDTH__ 32 +#define __WINT_MAX__ 2147483647 +#define __WINT_TYPE__ int +#define __WINT_WIDTH__ 32 +#define __arm 1 +#define __arm__ 1 +#define __clang__ 1 +#define __clang_major__ 7 +#define __clang_minor__ 0 +#define __clang_patchlevel__ 0 +#define __clang_version__ "7.0.0 " +#define __llvm__ 1 + +// unofficial defines +#define volatile(x) + +// compiler keywords +#define __alignof__(x) +#define __asm(x) +#define __asm +#define __asm__(x) +#define __forceinline +#define __restrict +#define __volatile__ +#define __inline +#define __inline__ +#define __declspec(x) +#define __attribute__(x) +#define __nonnull__(x) +#define __unaligned +#define __promise(x) +#define __irq +#define __swi +#define __weak +#define __register +#define __pure +#define __value_in_regs + +void __breakpoint(int val); +unsigned int __current_pc(void); +unsigned int __current_sp(void); +//int __disable_fiq(void); +//int __disable_irq(void); +void __enable_fiq(void); +void __enable_irq(void); +void __force_stores(void); +void __memory_changed(void); +void __schedule_barrier(void); +int __semihost(int val, const void *ptr); +unsigned int __vfp_status(unsigned int mask, unsigned int flags); + +typedef struct +{ + void *__ap; +} __builtin_va_list; +#define __builtin_va_arg(x, t) ((t)0) +#define __builtin_va_start(x, p) +#define __builtin_va_end(x) + +#define __builtin_arm_nop() +#define __builtin_arm_wfi() +#define __builtin_arm_wfe() +#define __builtin_arm_sev() +#define __builtin_arm_sevl() +#define __builtin_arm_yield() +#define __builtin_arm_isb(x) +#define __builtin_arm_dsb(x) +#define __builtin_arm_dmb(x) + +#define __builtin_bswap32(x) (x) +#define __builtin_bswap16(x) (x) +#define __builtin_arm_rbit(x) (x) + +#define __builtin_clz(x) (x) +#define __builtin_arm_ldrex(x) (x) +#define __builtin_arm_strex(val, ptr) (val) +#define __builtin_arm_ldrex(ptr) (ptr) +#define __builtin_arm_clrex() +#define __builtin_arm_ssat(val, sat) (sat) +#define __builtin_arm_usat(val, sat) (sat) +#define __builtin_arm_ldaex(ptr) (ptr) +#define __builtin_arm_stlex(val, ptr) (val) diff --git a/res/data/builtin_headers/lint_armgcc.h b/res/data/builtin_headers/lint_armgcc.h new file mode 100644 index 00000000..8c87542c --- /dev/null +++ b/res/data/builtin_headers/lint_armgcc.h @@ -0,0 +1,14 @@ +/*** + * !!! Don't include this file in your project !, it can only be used for code analysis !!! +*/ + +#ifndef __VSCODE_CPPTOOL +#error "Don't include this file in your project !, it can only be used for code analysis !" +#endif // ! + +#define __attribute__(x) + +#define __asm asm +#define __asm__ asm + +#define __volatile__ volatile diff --git a/res/data/builtin_headers/lint_iararm.h b/res/data/builtin_headers/lint_iararm.h new file mode 100644 index 00000000..611c94ca --- /dev/null +++ b/res/data/builtin_headers/lint_iararm.h @@ -0,0 +1,383 @@ +/*** + * !!! Don't include this file in your project !, it can only be used for code analysis !!! + */ + +#ifndef __VSCODE_CPPTOOL +#error "Don't include this file in your project !, it can only be used for code analysis !" +#endif // ! + +#ifdef _WIN32 +#undef _WIN32 +#endif + +#ifdef _MSC_VER +#undef _MSC_VER +#endif + +#ifdef __GNUC__ +#undef __GNUC__ +#endif + +// +// preprocessors +// + +#define __IAR_SYSTEMS_ICC__ 8 +#define __ICCarm__ 1 +#define __VER__ 7080002 + +// +// extended keywords +// + +#define __absolute // Makes references to the object use absolute addressing +#define __arm // Makes a function execute in ARM mode +#define __big_endian // Declares a variable to use the big-endian byte order +#define __fiq // Declares a fast interrupt function +#define __interwork // Declares a function to be callable from both ARM and Thumb mode +#define __intrinsic // Reserved for compiler internal use only +#define __irq // Declares an interrupt function +#define __little_endian // Declares a variable to use the little-endian byte order +#define __no_alloc // Makes a constant available in the execution file +#define __no_alloc16 // Makes a constant available in the execution file +#define __no_alloc_str(str) // Makes a string literal available in the execution file +#define __no_alloc_str16(str) // Makes a string literal available in the execution file +#define __nested // Allows an __irq declared interrupt function to be nested, that is, interruptible by the same type of interrupt +#define __no_init // Places a data object in non-volatile memory +#define __noreturn // Informs the compiler that the function will not return +#define __packed // Decreases data type alignment to 1 +#define __pcrel // Used internally by the compiler for constant data when the --ropi compiler option is used +#define __ramfunc // Makes a function execute in RAM +#define __root // Ensures that a function or variable is included in the object code even if unused +#define __ro_placement // Places const volatile data in read-only memory. +#define __sbrel // Used internally by the compiler for constant data when the --rwpi compiler option is used +#define __stackless // Makes a function callable without a working stack +#define __swi // Declares a software interrupt function +#define __task // Relaxes the rules for preserving registers +#define __thumb // Makes a function execute in Thumb mode +#define __weak // Declares a symbol to be externally weakly linked + +// +// intrinsic functions +// + +//__CLREX Inserts a CLREX instruction +void __CLREX(void); + +//__CLZ Inserts a CLZ instruction +unsigned char __CLZ(unsigned long); + +//__disable_fiq Disables fast interrupt requests (fiq) +void __disable_fiq(void); + +//__disable_interrupt Disables interrupts +void __disable_interrupt(void); + +//__disable_irq Disables interrupt requests (irq) +void __disable_irq(void); + +//__DMB Inserts a DMB instruction +void __DMB(void); + +//__DSB Inserts a DSB instruction +void __DSB(void); + +//__enable_fiq Enables fast interrupt requests (fiq) +void __enable_fiq(void); + +//__enable_interrupt Enables interrupts +void __enable_interrupt(void); + +//__enable_irq Enables interrupt requests (irq) +void __enable_irq(void); + +//__get_BASEPRI Returns the value of the Cortex-M3/Cortex-M4/Cortex-M7 BASEPRI register +unsigned long __get_BASEPRI(void); + +//__get_CONTROL Returns the value of the Cortex-M CONTROL register +unsigned long __get_CONTROL(void); + +//__get_CPSR Returns the value of the ARM CPSR (Current Program Status Register) +unsigned long __get_CPSR(void); + +//__get_FAULTMASK Returns the value of the Cortex-M3/Cortex-M4/Cortex-M7 FAULTMASK register +unsigned long __get_FAULTMASK(void); + +//__get_FPSCR Returns the value of FPSCR +unsigned long __get_FPSCR(void); + +typedef unsigned long __istate_t; +//__get_interrupt_state Returns the interrupt state +__istate_t __get_interrupt_state(void); + +//__get_IPSR Returns the value of the IPSR register +unsigned long __get_IPSR(void); + +//__get_LR Returns the value of the link register +unsigned long __get_LR(void); + +//__get_MSP Returns the value of the MSP register +unsigned long __get_MSP(void); + +//__get_PRIMASK Returns the value of the Cortex-M PRIMASK register +unsigned long __get_PRIMASK(void); + +//__get_PSP Returns the value of the PSP register +unsigned long __get_PSP(void); + +//__get_PSR Returns the value of the PSR register +unsigned long __get_PSR(void); + +//__get_SB Returns the value of the static base register +unsigned long __get_SB(void); + +//__get_SP Returns the value of the stack pointer register +unsigned long __get_SP(void); + +//__ISB Inserts an ISB instruction +void __ISB(void); + +typedef unsigned long __ul; + +//__LDC __LDCL __LDC2 __LDC2L Inserts the coprocessor load instruction LDC +void __LDC(__ul coproc, __ul CRn, __ul const *src); +void __LDCL(__ul coproc, __ul CRn, __ul const *src); +void __LDC2(__ul coproc, __ul CRn, __ul const *src); +void __LDC2L(__ul coproc, __ul CRn, __ul const *src); + +// __LDC_noidx __LDCL_noidx __LDC2_noidx __LDC2L_noidx Inserts the coprocessor load instruction LDC +// __LDC_noidx __LDCL_noidx __LDC2_noidx __LDC2L_noidx Inserts the coprocessor load instruction LDCL +// __LDC_noidx __LDCL_noidx __LDC2_noidx __LDC2L_noidx Inserts the coprocessor load instruction LDC2 +// __LDC_noidx __LDCL_noidx __LDC2_noidx __LDC2L_noidx Inserts the coprocessor load instruction LDC2L +void __LDC_noidx(__ul coproc, __ul CRn, __ul const *src, __ul option); +void __LDCL_noidx(__ul coproc, __ul CRn, __ul const *src, __ul option); +void __LDC2_noidx(__ul coproc, __ul CRn, __ul const *src, __ul option); +void __LDC2L_noidx(__ul coproc, __ul CRn, __ul const *src, __ul option); + +// __LDREX __LDREXB __LDREXD __LDREXH Inserts an LDREX instruction +// __LDREX __LDREXB __LDREXD __LDREXH Inserts an LDREXB instruction +// __LDREX __LDREXB __LDREXD __LDREXH Inserts an LDREXD instruction +// __LDREX __LDREXB __LDREXD __LDREXH Inserts an LDREXH instruction +unsigned long __LDREX(unsigned long *); +unsigned char __LDREXB(unsigned char *); +unsigned long long __LDREXD(unsigned long long *); +unsigned short __LDREXH(unsigned short *); + +// __MCR __MCR2 Inserts the coprocessor write instruction MCR +// __MCR __MCR2 Inserts the coprocessor write instruction MCR2 +void __MCR(__ul coproc, __ul opcode_1, __ul src, __ul CRn, __ul CRm, __ul opcode_2); +void __MCR2(__ul coproc, __ul opcode_1, __ul src, __ul CRn, __ul CRm, __ul opcode_2); + +// __MRC __MRC2 Inserts the coprocessor read instruction MRC +// __MRC __MRC2 Inserts the coprocessor read instruction MRC2 +unsigned long __MRC(__ul coproc, __ul opcode_1, __ul CRn, __ul CRm, __ul opcode_2); +unsigned long __MRC2(__ul coproc, __ul opcode_1, __ul CRn, __ul CRm, __ul opcode_2); + +//__no_operation Inserts a NOP instruction +void __no_operation(void); + +//__PKHBT Inserts a PKHBT instruction +unsigned long __PKHBT(unsigned long x, unsigned long y, unsigned long count); + +//__PKHTB Inserts a PKHTB instruction +unsigned long __PKHTB(unsigned long x, unsigned long y, unsigned long count); + +// _PLD __PLDW Inserts the preload data instruction PLD +// _PLD __PLDW Inserts the preload data instruction PLDW +void __PLD(void const *); +void __PLDW(void const *); + +//__PLI Inserts a PLI instruction +void __PLI(void const *); + +//__QADD __QDADD __QDSUB __QSUB Inserts a QADD instruction +signed long __QADD(signed long, signed long); +signed long __QDADD(signed long, signed long); +signed long __QDSUB(signed long, signed long); +signed long __QSUB(signed long, signed long); + +// __QADD8 __QADD16 __QASX __QSAX __QSUB8 __QSUB16 Inserts a QADD8 instruction +// __QADD8 __QADD16 __QASX __QSAX __QSUB8 __QSUB16 Inserts a QADD16 instruction +// __QADD8 __QADD16 __QASX __QSAX __QSUB8 __QSUB16 Inserts a QASX instruction +unsigned long __QADD8(unsigned long, unsigned long); +unsigned long __QADD16(unsigned long, unsigned long); +unsigned long __QASX(unsigned long, unsigned long); +unsigned long __QSAX(unsigned long, unsigned long); +unsigned long __QSUB8(unsigned long, unsigned long); +unsigned long __QSUB16(unsigned long, unsigned long); + +//__QCFlag Returns the value of the cumulative saturation flag of the FPSCR register +unsigned long __QCFlag(void); + +//__QDOUBLE Inserts a QDOUBLE instruction +signed long __QDOUBLE(signed long); + +//__QFlag Returns the Q flag that indicates if overflow/saturation has occurred +int __QFlag(void); + +//__RBIT Inserts an RBIT instruction +unsigned long __RBIT(unsigned long); + +//__reset_Q_flag Clears the Q flag that indicates if overflow/saturation has occurred +void __reset_Q_flag(void); + +//__reset_QC_flag Clears the value of the cumulative saturation flag QC of the FPSCR register +void __reset_QC_flag(void); + +// __REV __REV16 __REVSH Inserts an REV instruction +// __REV __REV16 __REVSH Inserts an REV16 instruction +// __REV __REV16 __REVSH Inserts an REVSH instruction +unsigned long __REV(unsigned long); +unsigned long __REV16(unsigned long); +signed long __REVSH(short); + +// __SADD8 __SADD16 __SASX __SSAX __SSUB8 __SSUB16 Inserts an SADD8 instruction +// __SADD8 __SADD16 __SASX __SSAX __SSUB8 __SSUB16 Inserts an SADD16 instruction +// __SADD8 __SADD16 __SASX __SSAX __SSUB8 __SSUB16 Inserts an SASX instruction +unsigned long __SADD8(unsigned long, unsigned long); +unsigned long __SADD16(unsigned long, unsigned long); +unsigned long __SASX(unsigned long, unsigned long); +unsigned long __SSAX(unsigned long, unsigned long); +unsigned long __SSUB8(unsigned long, unsigned long); +unsigned long __SSUB16(unsigned long, unsigned long); + +//__SEL Inserts an SEL instruction +unsigned long __SEL(unsigned long, unsigned long); + +//__set_BASEPRI Sets the value of the Cortex-M3/Cortex-M4/Cortex-M7 BASEPRI register +void __set_BASEPRI(unsigned long); + +//__set_CONTROL Sets the value of the Cortex-M CONTROL register +void __set_CONTROL(unsigned long); + +//__set_CPSR Sets the value of the ARM CPSR (Current Program Status Register) +void __set_CPSR(unsigned long); + +//__set_FAULTMASK Sets the value of the Cortex-M3/Cortex-M4/Cortex-M7 FAULTMASK register +void __set_FAULTMASK(unsigned long); + +//__set_FPSCR Sets the value of the FPSCR register +void __set_FPSCR(unsigned long); + +//__set_interrupt_state Restores the interrupt state +void __set_interrupt_state(__istate_t); + +//__set_LR Assigns a new address to the link register +void __set_LR(unsigned long); + +//__set_MSP Sets the value of the MSP register +void __set_MSP(unsigned long); + +//__set_PRIMASK Sets the value of the Cortex-M PRIMASK register +void __set_PRIMASK(unsigned long); + +//__set_PSP Sets the value of the PSP register +void __set_PSP(unsigned long); + +//__set_SB Assigns a new address to the static base register +void __set_SB(unsigned long); + +//__set_SP Assigns a new address to the stack pointer register +void __set_SP(unsigned long); + +//__SEV Inserts an SEV instruction +void __SEV(void); + +// __SHADD8 __SHADD16 __SHASX __SHSAX __SHSUB8 __SHSUB16 Inserts an SHADD8 instruction +// __SHADD8 __SHADD16 __SHASX __SHSAX __SHSUB8 __SHSUB16 Inserts an SHADD16 instruction +// __SHADD8 __SHADD16 __SHASX __SHSAX __SHSUB8 __SHSUB16 Inserts an SHASX instruction +// __SHADD8 __SHADD16 __SHASX __SHSAX __SHSUB8 __SHSUB16 Inserts an SHSAX instruction +// __SHADD8 __SHADD16 __SHASX __SHSAX __SHSUB8 __SHSUB16 Inserts an SHSUB8 instruction +// __SHADD8 __SHADD16 __SHASX __SHSAX __SHSUB8 __SHSUB16 Inserts an SHSUB16 instruction +// __SMLABB __SMLABT __SMLATB __SMLATT __SMLAWB __SMLAWT Inserts an SMLABB instruction +// __SMLABB __SMLABT __SMLATB __SMLATT __SMLAWB __SMLAWT Inserts an SMLABT instruction +// __SMLAD __SMLADX __SMLSD __SMLSDX Inserts an SMLAD instruction +// __SMLAD __SMLADX __SMLSD __SMLSDX Inserts an SMLADX instruction +// __SMLALBB __SMLALBT __SMLALTB __SMLALTT Inserts an SMLALBB instruction +// __SMLALBB __SMLALBT __SMLALTB __SMLALTT Inserts an SMLALBT instruction +// __SMLALD __SMLALDX __SMLSLD __SMLSLDX Inserts an SMLALD instruction +// __SMLALD __SMLALDX __SMLSLD __SMLSLDX Inserts an SMLALDX instruction +// __SMLALBB __SMLALBT __SMLALTB __SMLALTT Inserts an SMLALTB instruction +// __SMLALBB __SMLALBT __SMLALTB __SMLALTT Inserts an SMLALTT instruction +// __SMLABB __SMLABT __SMLATB __SMLATT __SMLAWB __SMLAWT Inserts an SMLATB instruction +// __SMLABB __SMLABT __SMLATB __SMLATT __SMLAWB __SMLAWT Inserts an SMLATT instruction +// __SMLABB __SMLABT __SMLATB __SMLATT __SMLAWB __SMLAWT Inserts an SMLAWB instruction +// __SMLABB __SMLABT __SMLATB __SMLATT __SMLAWB __SMLAWT Inserts an SMLAWT instruction +// __SMLAD __SMLADX __SMLSD __SMLSDX Inserts an SMLSD instruction +// __SMLAD __SMLADX __SMLSD __SMLSDX Inserts an SMLSDX instruction +// __SMLALD __SMLALDX __SMLSLD __SMLSLDX Inserts an SMLSLD instruction +// __SMLALD __SMLALDX __SMLSLD __SMLSLDX Inserts an SMLSLDX instruction +// __SMMLA __SMMLAR __SMMLS __SMMLSR Inserts an SMMLA instruction +// __SMMLA __SMMLAR __SMMLS __SMMLSR Inserts an SMMLAR instruction +// __SMMLA __SMMLAR __SMMLS __SMMLSR Inserts an SMMLS instruction +// __SMMLA __SMMLAR __SMMLS __SMMLSR Inserts an SMMLSR instruction +// __SMMUL __SMMULR Inserts an SMMUL instruction +// __SMMUL __SMMULR Inserts an SMMULR instruction +// __SMUAD __SMUADX __SMUSD __SMUSDX Inserts an SMUAD instruction +// __SMUAD __SMUADX __SMUSD __SMUSDX Inserts an SMUADX instruction +// __SMUL Inserts a signed 16-bit multiplication +// __SMULBB __SMULBT __SMULTB __SMULTT __SMULWB __SMULWT Inserts an SMULBB instruction +// __SMULBB __SMULBT __SMULTB __SMULTT __SMULWB __SMULWT Inserts an SMULBT instruction +// __SMULBB __SMULBT __SMULTB __SMULTT __SMULWB __SMULWT Inserts an SMULTB instruction +// __SMULBB __SMULBT __SMULTB __SMULTT __SMULWB __SMULWT Inserts an SMULTT instruction +// __SMULBB __SMULBT __SMULTB __SMULTT __SMULWB __SMULWT Inserts an SMULWB instruction +// __SMULBB __SMULBT __SMULTB __SMULTT __SMULWB __SMULWT Inserts an SMULWT instruction +// __SMUAD __SMUADX __SMUSD __SMUSDX Inserts an SMUSD instruction +// __SMUAD __SMUADX __SMUSD __SMUSDX Inserts an SMUSDX instruction +// __SSAT Inserts an SSAT instruction +// __SSAT16 Inserts an SSAT16 instruction +// __SADD8 __SADD16 __SASX __SSAX __SSUB8 __SSUB16 Inserts an SSAX instruction +// __SADD8 __SADD16 __SASX __SSAX __SSUB8 __SSUB16 Inserts an SSUB8 instruction +// __SADD8 __SADD16 __SASX __SSAX __SSUB8 __SSUB16 Inserts an SSUB16 instruction +// __STC __STCL __STC2 __STC2L Inserts the coprocessor store instruction STC +// __STC __STCL __STC2 __STC2L Inserts the coprocessor store instruction STCL +// __STC __STCL __STC2 __STC2L Inserts the coprocessor store instruction STC2 +// __STC __STCL __STC2 __STC2L Inserts the coprocessor store instruction STC2L +// __STC_noidx __STCL_noidx __STC2_noidx __STC2L_noidx Inserts the coprocessor store instruction STC +// __STC_noidx __STCL_noidx __STC2_noidx __STC2L_noidx Inserts the coprocessor store instruction STCL +// __STC_noidx __STCL_noidx __STC2_noidx __STC2L_noidx Inserts the coprocessor store instruction STC2 +// __STC_noidx __STCL_noidx __STC2_noidx __STC2L_noidx Inserts the coprocessor store instruction STC2L +// __STREX __STREXB __STREXD __STREXH Inserts a STREX instruction +// __STREX __STREXB __STREXD __STREXH Inserts a STREXB instruction +// __STREX __STREXB __STREXD __STREXH Inserts a STREXD instruction +// __STREX __STREXB __STREXD __STREXH Inserts a STREXH instruction +// __SWP __SWPB Inserts an SWP instruction +// __SWP __SWPB Inserts an SWPB instruction +// __SXTAB __SXTAB16 __SXTAH __SXTB16 Inserts an SXTAB instruction +// __SXTAB __SXTAB16 __SXTAH __SXTB16 Inserts an SXTAB16 instruction +// __SXTAB __SXTAB16 __SXTAH __SXTB16 Inserts an SXTAH instruction +// __SXTAB __SXTAB16 __SXTAH __SXTB16 Inserts an SXTB16 instruction +// __UADD8 __UADD16 __UASX __USAX __USUB8 __USUB16 Inserts a UADD8 instruction +// __UADD8 __UADD16 __UASX __USAX __USUB8 __USUB16 Inserts a UADD16 instruction +// __UADD8 __UADD16 __UASX __USAX __USUB8 __USUB16 Inserts a UASX instruction +// __UHADD8 __UHADD16 __UHASX __UHSAX __UHSUB8 __UHSUB16 Inserts a UHADD8 instruction +// __UHADD8 __UHADD16 __UHASX __UHSAX __UHSUB8 __UHSUB16 Inserts a UHADD16 instruction +// __UHADD8 __UHADD16 __UHASX __UHSAX __UHSUB8 __UHSUB16 Inserts a UHASX instruction +// __UHADD8 __UHADD16 __UHASX __UHSAX __UHSUB8 __UHSUB16 Inserts a UHSAX instruction +// __UHADD8 __UHADD16 __UHASX __UHSAX __UHSUB8 __UHSUB16 Inserts a UHSUB8 instruction +// __UHADD8 __UHADD16 __UHASX __UHSAX __UHSUB8 __UHSUB16 Inserts a UHSUB16 instruction +// __UMAAL Inserts a UMAAL instruction +// __UQADD8 __UQADD16 __UQASX __UQSAX __UQSUB8 __UQSUB16 Inserts a UQADD8 instruction +// __UQADD8 __UQADD16 __UQASX __UQSAX __UQSUB8 __UQSUB16 Inserts a UQADD16 instruction +// __UQADD8 __UQADD16 __UQASX __UQSAX __UQSUB8 __UQSUB16 Inserts a UQASX instruction +// __UQADD8 __UQADD16 __UQASX __UQSAX __UQSUB8 __UQSUB16 Inserts a UQSAX instruction +// __UQADD8 __UQADD16 __UQASX __UQSAX __UQSUB8 __UQSUB16 Inserts a UQSUB8 instruction +// __UQADD8 __UQADD16 __UQASX __UQSAX __UQSUB8 __UQSUB16 Inserts a UQSUB16 instruction +// __USAD8 __USADA8 Inserts a USAD8 instruction +// __USAD8 __USADA8 Inserts a USADA8 instruction +// __USAT Inserts a USAT instruction +// __USAT16 Inserts a USAT16 instruction +// __UADD8 __UADD16 __UASX __USAX __USUB8 __USUB16 Inserts a USAX instruction +// __UADD8 __UADD16 __UASX __USAX __USUB8 __USUB16 Inserts a USUB8 instruction +// __UADD8 __UADD16 __UASX __USAX __USUB8 __USUB16 Inserts a USUB16 instruction +// __UXTAB __UXTAB16 __UXTAH __UXTB16 Inserts a UXTAB instruction +// __UXTAB __UXTAB16 __UXTAH __UXTB16 Inserts a UXTAB16 instruction +// __UXTAB __UXTAB16 __UXTAH __UXTB16 Inserts a UXTAH instruction +// __UXTAB __UXTAB16 __UXTAH __UXTB16 Inserts a UXTB16 instruction + +// __WFI __WFE __YIELD Inserts a WFE instruction +// __WFI __WFE __YIELD Inserts a WFI instruction +// __WFI __WFE __YIELD Inserts a YIELD instruction +long __WFI(void); +long __WFE(void); +long __YIELD(void); diff --git a/res/data/builtin_headers/lint_iarstm8.h b/res/data/builtin_headers/lint_iarstm8.h new file mode 100644 index 00000000..4f354381 --- /dev/null +++ b/res/data/builtin_headers/lint_iarstm8.h @@ -0,0 +1,326 @@ +/*** + * !!! Don't include this file in your project !, it can only be used for code analysis !!! +*/ + +#ifndef __VSCODE_CPPTOOL +#error "Don't include this file in your project !, it can only be used for code analysis !" +#endif // ! + +#ifdef _WIN32 +#undef _WIN32 +#endif + +#ifdef _MSC_VER +#undef _MSC_VER +#endif + +#ifdef __GNUC__ +#undef __GNUC__ +#endif + +// keywords +#define __eeprom +#define __far +#define __far_func +#define __huge +#define __huge_func +#define __interrupt +#define __intrinsic +#define __monitor +#define __near +#define __near_func +#define __no_init +#define __noreturn +#define __ramfunc +#define __root +#define __ro_placement +#define __task +#define __tiny +#define __trap() +#define __weak + +#define asm(str) +#define __asm(str) +#define _Pragma(x) +#define __ALIGNOF__(x) +#define __nounwind +#define __data16 +#define __regvar +#define __raw +#define __save_reg20 + +// compiler predefine macros +#define __CHAR_BITS__ 8 +#define __CHAR_MAX__ 0xff +#define __CHAR_MIN__ 0 +#define __CHAR_SIZE__ 1 +#define __UNSIGNED_CHAR_MAX__ 0xff +#define __SIGNED_CHAR_MAX__ 127 +#define __SIGNED_CHAR_MIN__ (-__SIGNED_CHAR_MAX__-1) +#define __CHAR_ALIGN__ 1 +#define __SHORT_SIZE__ 2 +#define __UNSIGNED_SHORT_MAX__ 0xffffU +#define __SIGNED_SHORT_MAX__ 32767 +#define __SIGNED_SHORT_MIN__ (-__SIGNED_SHORT_MAX__-1) +#define __SHORT_ALIGN__ 1 +#define __INT_SIZE__ 2 +#define __UNSIGNED_INT_MAX__ 0xffffU +#define __SIGNED_INT_MAX__ 32767 +#define __SIGNED_INT_MIN__ (-__SIGNED_INT_MAX__-1) +#define __INT_ALIGN__ 1 +#define __LONG_SIZE__ 4 +#define __UNSIGNED_LONG_MAX__ 0xffffffffUL +#define __SIGNED_LONG_MAX__ 2147483647L +#define __SIGNED_LONG_MIN__ (-__SIGNED_LONG_MAX__-1) +#define __LONG_ALIGN__ 1 +#define __LONG_LONG_SIZE__ 4 +#define __UNSIGNED_LONG_LONG_MAX__ 0xffffffffULL +#define __SIGNED_LONG_LONG_MAX__ 2147483647LL +#define __SIGNED_LONG_LONG_MIN__ (-__SIGNED_LONG_LONG_MAX__-1) +#define __LONG_LONG_ALIGN__ 1 +#define __INT8_T_TYPE__ signed char +#define __INT8_T_MAX__ 127 +#define __INT8_T_MIN__ (-__INT8_T_MAX__-1) +#define __UINT8_T_TYPE__ unsigned char +#define __UINT8_T_MAX__ 0xff +#define __INT8_SIZE_PREFIX__ "hh" +#define __INT16_T_TYPE__ signed int +#define __INT16_T_MAX__ 32767 +#define __INT16_T_MIN__ (-__INT16_T_MAX__-1) +#define __UINT16_T_TYPE__ unsigned int +#define __UINT16_T_MAX__ 0xffffU +#define __INT16_SIZE_PREFIX__ "" +#define __INT32_T_TYPE__ signed long int +#define __INT32_T_MAX__ 2147483647L +#define __INT32_T_MIN__ (-__INT32_T_MAX__-1) +#define __UINT32_T_TYPE__ unsigned long int +#define __UINT32_T_MAX__ 0xffffffffUL +#define __INT32_SIZE_PREFIX__ "l" +#define __INT_LEAST8_T_TYPE__ signed char +#define __INT_LEAST8_T_MAX__ 127 +#define __INT_LEAST8_T_MIN__ (-__INT_LEAST8_T_MAX__-1) +#define __UINT_LEAST8_T_TYPE__ unsigned char +#define __UINT_LEAST8_T_MAX__ 0xff +#define __INT8_C_SUFFIX__ +#define __UINT8_C_SUFFIX__ +#define __INT_LEAST8_SIZE_PREFIX__ "hh" +#define __INT_LEAST16_T_TYPE__ signed int +#define __INT_LEAST16_T_MAX__ 32767 +#define __INT_LEAST16_T_MIN__ (-__INT_LEAST16_T_MAX__-1) +#define __UINT_LEAST16_T_TYPE__ unsigned int +#define __UINT_LEAST16_T_MAX__ 0xffffU +#define __INT16_C_SUFFIX__ +#define __UINT16_C_SUFFIX__ U +#define __INT_LEAST16_SIZE_PREFIX__ "" +#define __INT_LEAST32_T_TYPE__ signed long int +#define __INT_LEAST32_T_MAX__ 2147483647L +#define __INT_LEAST32_T_MIN__ (-__INT_LEAST32_T_MAX__-1) +#define __UINT_LEAST32_T_TYPE__ unsigned long int +#define __UINT_LEAST32_T_MAX__ 0xffffffffUL +#define __INT32_C_SUFFIX__ L +#define __UINT32_C_SUFFIX__ UL +#define __INT_LEAST32_SIZE_PREFIX__ "l" +#define __INT_FAST8_T_TYPE__ signed char +#define __INT_FAST8_T_MAX__ 127 +#define __INT_FAST8_T_MIN__ (-__INT_FAST8_T_MAX__-1) +#define __UINT_FAST8_T_TYPE__ unsigned char +#define __UINT_FAST8_T_MAX__ 0xff +#define __INT_FAST8_SIZE_PREFIX__ "hh" +#define __INT_FAST16_T_TYPE__ signed int +#define __INT_FAST16_T_MAX__ 32767 +#define __INT_FAST16_T_MIN__ (-__INT_FAST16_T_MAX__-1) +#define __UINT_FAST16_T_TYPE__ unsigned int +#define __UINT_FAST16_T_MAX__ 0xffffU +#define __INT_FAST16_SIZE_PREFIX__ "" +#define __INT_FAST32_T_TYPE__ signed long int +#define __INT_FAST32_T_MAX__ 2147483647L +#define __INT_FAST32_T_MIN__ (-__INT_FAST32_T_MAX__-1) +#define __UINT_FAST32_T_TYPE__ unsigned long int +#define __UINT_FAST32_T_MAX__ 0xffffffffUL +#define __INT_FAST32_SIZE_PREFIX__ "l" +#define __INTMAX_T_TYPE__ signed long int +#define __INTMAX_T_MAX__ 2147483647L +#define __INTMAX_T_MIN__ (-__INTMAX_T_MAX__-1) +#define __UINTMAX_T_TYPE__ unsigned long int +#define __UINTMAX_T_MAX__ 0xffffffffUL +#define __INTMAX_C_SUFFIX__ L +#define __UINTMAX_C_SUFFIX__ UL +#define __INTMAX_SIZE_PREFIX__ "l" +#define __FLOAT_SIZE__ 4 +#define __FLOAT_ALIGN__ 1 +#define __DOUBLE_SIZE__ 4 +#define __DOUBLE_ALIGN__ 1 +#define __LONG_DOUBLE_SIZE__ 4 +#define __LONG_DOUBLE_ALIGN__ 1 +#define __NAN_HAS_HIGH_MANTISSA_BIT_SET__ 0 +#define __SUBNORMAL_FLOATING_POINTS__ 1 +#define __SIZE_T_TYPE__ unsigned short int +#define __SIZE_T_MAX__ 0xffffU +#define __PTRDIFF_T_TYPE__ signed short int +#define __PTRDIFF_T_MAX__ 32767 +#define __PTRDIFF_T_MIN__ (-__PTRDIFF_T_MAX__-1) +#define __INTPTR_T_TYPE__ signed short int +#define __INTPTR_T_MAX__ 32767 +#define __INTPTR_T_MIN__ (-__INTPTR_T_MAX__-1) +#define __UINTPTR_T_TYPE__ unsigned short int +#define __UINTPTR_T_MAX__ 0xffffU +#define __INTPTR_SIZE_PREFIX__ "h" +#define __JMP_BUF_ELEMENT_TYPE__ unsigned char +#define __JMP_BUF_NUM_ELEMENTS__ 29 +#define __TID__ 0x3800 +#define __VER__ 311 +#define __SUBVERSION__ 1 +#define __BUILD_NUMBER__ 207 +#define __IAR_SYSTEMS_ICC__ 8 +#define __VA_STACK_DECREASING__ 1 +#define __VA_STACK_ALIGN__ 1 +#define __VA_STACK_ALIGN_EXTRA_BEFORE__ 1 +#define __LITTLE_ENDIAN__ 0 +#define __BOOL_TYPE__ unsigned char +#define __BOOL_SIZE__ 1 +#define __WCHAR_T_TYPE__ unsigned short int +#define __WCHAR_T_SIZE__ 2 +#define __WCHAR_T_MAX__ 0xffffU +#define __DEF_PTR_MEM__ __near +#define __DEF_PTR_SIZE__ 2 +#define __CODE_MEMORY_LIST1__() __CODE_MEM_HELPER1__(__far_func, 0) __CODE_MEM_HELPER1__(__huge_func, 1) +#define __CODE_MEMORY_LIST2__(_P1) __CODE_MEM_HELPER2__(__far_func, 0, _P1) __CODE_MEM_HELPER2__(__huge_func, 1, _P1) +#define __CODE_MEMORY_LIST3__(_P1,_P2) __CODE_MEM_HELPER3__(__far_func, 0, _P1, _P2) __CODE_MEM_HELPER3__(__huge_func, 1, _P1, _P2) +#define __DATA_MEMORY_LIST1__() __DATA_MEM_HELPER1__(__tiny, 0) __DATA_MEM_HELPER1__(__near, 1) __DATA_MEM_HELPER1__(__far, 2) __DATA_MEM_HELPER1__(__huge, 3) __DATA_MEM_HELPER1__(__eeprom, 4) +#define __DATA_MEMORY_LIST2__(_P1) __DATA_MEM_HELPER2__(__tiny, 0, _P1) __DATA_MEM_HELPER2__(__near, 1, _P1) __DATA_MEM_HELPER2__(__far, 2, _P1) __DATA_MEM_HELPER2__(__huge, 3, _P1) __DATA_MEM_HELPER2__(__eeprom, 4, _P1) +#define __DATA_MEMORY_LIST3__(_P1,_P2) __DATA_MEM_HELPER3__(__tiny, 0, _P1, _P2) __DATA_MEM_HELPER3__(__near, 1, _P1, _P2) __DATA_MEM_HELPER3__(__far, 2, _P1, _P2) __DATA_MEM_HELPER3__(__huge, 3, _P1, _P2) __DATA_MEM_HELPER3__(__eeprom, 4, _P1, _P2) +#define __CODE_MEM0__ __far_func +#define __CODE_MEM0_POINTER_OK__ 1 +#define __CODE_MEM0_UNIQUE_POINTER__ 0 +#define __CODE_MEM0_VAR_OK__ 1 +#define __CODE_MEM1__ __huge_func +#define __CODE_MEM1_POINTER_OK__ 1 +#define __CODE_MEM1_UNIQUE_POINTER__ 1 +#define __CODE_MEM1_VAR_OK__ 1 +#define __DATA_MEM0__ __tiny +#define __DATA_MEM0_POINTER_OK__ 1 +#define __DATA_MEM0_UNIQUE_POINTER__ 1 +#define __DATA_MEM0_VAR_OK__ 1 +#define __DATA_MEM0_INDEX_TYPE__ signed char +#define __DATA_MEM0_SIZE_TYPE__ unsigned char +#define __DATA_MEM0_INTPTR_TYPE__ signed char +#define __DATA_MEM0_UINTPTR_TYPE__ unsigned char +#define __DATA_MEM0_INTPTR_SIZE_PREFIX__ "hh" +#define __DATA_MEM0_MAX_SIZE__ 0xff +#define __DATA_MEM1__ __near +#define __DATA_MEM1_POINTER_OK__ 1 +#define __DATA_MEM1_UNIQUE_POINTER__ 1 +#define __DATA_MEM1_VAR_OK__ 1 +#define __DATA_MEM1_INDEX_TYPE__ short +#define __DATA_MEM1_SIZE_TYPE__ unsigned short +#define __DATA_MEM1_INTPTR_TYPE__ short int +#define __DATA_MEM1_UINTPTR_TYPE__ unsigned short int +#define __DATA_MEM1_INTPTR_SIZE_PREFIX__ "h" +#define __DATA_MEM1_MAX_SIZE__ 0xffff +#define __DATA_MEM1_HEAP_SEGMENT__ "HEAP" +#define __DATA_MEM1_PAGE_SIZE__ 0 +#define __DATA_MEM1_HEAP__ 1 +#define __DATA_MEM2__ __far +#define __DATA_MEM2_POINTER_OK__ 1 +#define __DATA_MEM2_UNIQUE_POINTER__ 1 +#define __DATA_MEM2_VAR_OK__ 1 +#define __DATA_MEM2_INDEX_TYPE__ short +#define __DATA_MEM2_SIZE_TYPE__ unsigned short +#define __DATA_MEM2_INTPTR_TYPE__ long int +#define __DATA_MEM2_UINTPTR_TYPE__ unsigned long int +#define __DATA_MEM2_INTPTR_SIZE_PREFIX__ "l" +#define __DATA_MEM2_MAX_SIZE__ 0xffff +#define __DATA_MEM3__ __huge +#define __DATA_MEM3_POINTER_OK__ 1 +#define __DATA_MEM3_UNIQUE_POINTER__ 1 +#define __DATA_MEM3_VAR_OK__ 1 +#define __DATA_MEM3_INDEX_TYPE__ long +#define __DATA_MEM3_SIZE_TYPE__ unsigned long +#define __DATA_MEM3_INTPTR_TYPE__ long int +#define __DATA_MEM3_UINTPTR_TYPE__ unsigned long int +#define __DATA_MEM3_INTPTR_SIZE_PREFIX__ "l" +#define __DATA_MEM3_MAX_SIZE__ 0xffffffff +#define __DATA_MEM4__ __eeprom +#define __DATA_MEM4_POINTER_OK__ 1 +#define __DATA_MEM4_UNIQUE_POINTER__ 1 +#define __DATA_MEM4_VAR_OK__ 1 +#define __DATA_MEM4_INDEX_TYPE__ short +#define __DATA_MEM4_SIZE_TYPE__ unsigned short +#define __DATA_MEM4_INTPTR_TYPE__ short int +#define __DATA_MEM4_UINTPTR_TYPE__ unsigned short int +#define __DATA_MEM4_INTPTR_SIZE_PREFIX__ "h" +#define __DATA_MEM4_MAX_SIZE__ 0xffff +#define __CODE_PTR_MEMORY_LIST1__() __CODE_PTR_MEM_HELPER1__(__huge_func, 1) +#define __CODE_PTR_MEMORY_LIST2__(_P1) __CODE_PTR_MEM_HELPER2__(__huge_func, 1, _P1) +#define __CODE_PTR_MEMORY_LIST3__(_P1,_P2) __CODE_PTR_MEM_HELPER3__(__huge_func, 1, _P1, _P2) +#define __DATA_PTR_MEMORY_LIST1__() __DATA_PTR_MEM_HELPER1__(__tiny, 0) __DATA_PTR_MEM_HELPER1__(__near, 1) __DATA_PTR_MEM_HELPER1__(__far, 2) __DATA_PTR_MEM_HELPER1__(__huge, 3) __DATA_PTR_MEM_HELPER1__(__eeprom, 4) +#define __DATA_PTR_MEMORY_LIST2__(_P1) __DATA_PTR_MEM_HELPER2__(__tiny, 0, _P1) __DATA_PTR_MEM_HELPER2__(__near, 1, _P1) __DATA_PTR_MEM_HELPER2__(__far, 2, _P1) __DATA_PTR_MEM_HELPER2__(__huge, 3, _P1) __DATA_PTR_MEM_HELPER2__(__eeprom, 4, _P1) +#define __DATA_PTR_MEMORY_LIST3__(_P1,_P2) __DATA_PTR_MEM_HELPER3__(__tiny, 0, _P1, _P2) __DATA_PTR_MEM_HELPER3__(__near, 1, _P1, _P2) __DATA_PTR_MEM_HELPER3__(__far, 2, _P1, _P2) __DATA_PTR_MEM_HELPER3__(__huge, 3, _P1, _P2) __DATA_PTR_MEM_HELPER3__(__eeprom, 4, _P1, _P2) +#define __VAR_MEMORY_LIST1__() __VAR_MEM_HELPER1__(__tiny, 0) __VAR_MEM_HELPER1__(__near, 1) __VAR_MEM_HELPER1__(__far, 2) __VAR_MEM_HELPER1__(__huge, 3) __VAR_MEM_HELPER1__(__eeprom, 4) +#define __VAR_MEMORY_LIST2__(_P1) __VAR_MEM_HELPER2__(__tiny, 0, _P1) __VAR_MEM_HELPER2__(__near, 1, _P1) __VAR_MEM_HELPER2__(__far, 2, _P1) __VAR_MEM_HELPER2__(__huge, 3, _P1) __VAR_MEM_HELPER2__(__eeprom, 4, _P1) +#define __VAR_MEMORY_LIST3__(_P1,_P2) __VAR_MEM_HELPER3__(__tiny, 0, _P1, _P2) __VAR_MEM_HELPER3__(__near, 1, _P1, _P2) __VAR_MEM_HELPER3__(__far, 2, _P1, _P2) __VAR_MEM_HELPER3__(__huge, 3, _P1, _P2) __VAR_MEM_HELPER3__(__eeprom, 4, _P1, _P2) +#define __VARD_MEMORY_LIST1__() __VARD_MEM_HELPER1__(__tiny, 0, __tiny) __VARD_MEM_HELPER1__(__near, 1, _) __VARD_MEM_HELPER1__(__far, 2, __far) __VARD_MEM_HELPER1__(__huge, 3, __huge) __VARD_MEM_HELPER1__(__eeprom, 4, __eeprom) +#define __HEAP_MEM0__ 1 +#define __HEAP_DEFAULT_MEM__ 1 +#define __HEAP_MEMORY_LIST1__() __HEAP_MEM_HELPER1__(__near, 1) +#define __HEAP_MEMORY_LIST2__(_P1) __HEAP_MEM_HELPER2__(__near, 1, _P1) +#define __HEAP_MEMORY_LIST3__(_P1,_P2) __HEAP_MEM_HELPER3__(__near, 1, _P1, _P2) +#define __HVAR_MEMORY_LIST1__() __HVAR_MEM_HELPER1__(__tiny, 0) __HVAR_MEM_HELPER1__(__near, 1) __HVAR_MEM_HELPER1__(__far, 2) __HVAR_MEM_HELPER1__(__huge, 3) __HVAR_MEM_HELPER1__(__eeprom, 4) +#define __HEAPD_MEMORY_LIST1__() __HEAPD_MEM_HELPER1__(__near, 1, _) +#define __HEAPU_MEMORY_LIST1__() __HEAPU_MEM_HELPER1__(__near, 1) +#define __MULTIPLE_HEAPS__ 0 +#define __TOPM_DATA_MEMORY_LIST1__() __TOPM_DATA_MEM_HELPER1__(__huge, 3) __TOPM_DATA_MEM_HELPER1__(__eeprom, 4) +#define __TOPM_DATA_MEMORY_LIST2__(_P1) __TOPM_DATA_MEM_HELPER2__(__huge, 3, _P1) __TOPM_DATA_MEM_HELPER2__(__eeprom, 4, _P1) +#define __TOPM_DATA_MEMORY_LIST3__(_P1,_P2) __TOPM_DATA_MEM_HELPER3__(__huge, 3, _P1, _P2) __TOPM_DATA_MEM_HELPER3__(__eeprom, 4, _P1, _P2) +#define __TOPP_DATA_MEMORY_LIST1__() __TOPP_DATA_MEM_HELPER1__(__near, 1) __TOPP_DATA_MEM_HELPER1__(__huge, 3) __TOPP_DATA_MEM_HELPER1__(__eeprom, 4) +#define __TOPP_DATA_MEMORY_LIST2__(_P1) __TOPP_DATA_MEM_HELPER2__(__near, 1, _P1) __TOPP_DATA_MEM_HELPER2__(__huge, 3, _P1) __TOPP_DATA_MEM_HELPER2__(__eeprom, 4, _P1) +#define __TOPP_DATA_MEMORY_LIST3__(_P1,_P2) __TOPP_DATA_MEM_HELPER3__(__near, 1, _P1, _P2) __TOPP_DATA_MEM_HELPER3__(__huge, 3, _P1, _P2) __TOPP_DATA_MEM_HELPER3__(__eeprom, 4, _P1, _P2) +#define __DEF_HEAP_MEM__ __near +#define __MULTIPLE_INHERITANCE__ 1 +#define _RTSL_COMPARE_T unsigned char +#define __CODE_MODEL__ __MEDIUM_CODE_MODEL__ +#define __CORE__ __STM8__ +#define __DATA_MODEL__ __MEDIUM_DATA_MODEL__ +#define __ICCSTM8__ 1 +#define __LARGE_CODE_MODEL__ 3 +#define __LARGE_DATA_MODEL__ 3 +#define __MEDIUM_CODE_MODEL__ 2 +#define __MEDIUM_DATA_MODEL__ 2 +#define __SMALL_CODE_MODEL__ 1 +#define __SMALL_DATA_MODEL__ 1 +#define __STM8__ 1 +#define __PLAIN_INT_BITFIELD_IS_SIGNED__ 1 +#define __HAS_WEAK__ 1 +#define __HAS_LOCATED_DECLARATION__ 1 +#define __HAS_LOCATED_WITH_INIT__ 1 +#define __IAR_COMPILERBASE__ 595716 +#define __STDC__ 1 +#define __STDC_VERSION__ 199901L +#define __STDC_HOSTED__ 1 +#define __STDC_NO_VLA__ 1 +#define __STDC_NO_ATOMICS__ 1 +#define __EDG_IA64_ABI 1 +#define __EDG_IA64_ABI_VARIANT_CTORS_AND_DTORS_RETURN_THIS 1 +#define __EDG_IA64_ABI_USE_INT_STATIC_INIT_GUARD 1 +#define __EDG_TYPE_TRAITS_ENABLED 1 +#define __EDG__ 1 +#define __EDG_VERSION__ 410 +#define __EDG_SIZE_TYPE__ unsigned short +#define __EDG_PTRDIFF_TYPE__ short +#define __EDG_DELTA_TYPE short +#define __EDG_IA64_VTABLE_ENTRY_TYPE short +#define __EDG_VIRTUAL_FUNCTION_INDEX_TYPE unsigned short +#define __EDG_LOWER_VARIABLE_LENGTH_ARRAYS 1 +#define __EDG_IA64_ABI_USE_VARIANT_ARRAY_COOKIES 1 +#define __EDG_ABI_COMPATIBILITY_VERSION 9999 +#define __EDG_ABI_CHANGES_FOR_RTTI 1 +#define __EDG_ABI_CHANGES_FOR_ARRAY_NEW_AND_DELETE 1 +#define __EDG_ABI_CHANGES_FOR_PLACEMENT_DELETE 1 +#define __EDG_BSD 0 +#define __EDG_SYSV 0 +#define __EDG_ANSIC 1 +#define __EDG_CPP11_IL_EXTENSIONS_SUPPORTED 1 +#define _DLIB_CONFIG_FILE_HEADER_NAME "DLib_Config_Normal.h" +#define _DLIB_CONFIG_FILE_STRING "DLib_Config_Normal.h" +#define __VERSION__ "IAR C/C++ Compiler V3.11.1.207 for STM8" + diff --git a/res/data/builtin_headers/lint_keilc51.h b/res/data/builtin_headers/lint_keilc51.h new file mode 100644 index 00000000..e483e290 --- /dev/null +++ b/res/data/builtin_headers/lint_keilc51.h @@ -0,0 +1,46 @@ +/*** + * !!! Don't include this file in your project !, it can only be used for code analysis !!! +*/ + +#ifndef __VSCODE_CPPTOOL +#error "Don't include this file in your project !, it can only be used for code analysis !" +#endif // ! + +#ifdef _WIN32 +#undef _WIN32 +#endif + +#ifdef _MSC_VER +#undef _MSC_VER +#endif + +#define __C51__ + +// keywords + +#define interrupt +#define using +#define _at_ +#define _priority_ +#define _task_ + +// storage type + +#define reentrant +#define compact +#define small +#define large +#define data +#define bdata +#define idata +#define pdata +#define xdata +#define code + +// internal value type + +typedef _Bool bit; +typedef volatile _Bool sbit; +typedef volatile unsigned char sfr; +typedef volatile unsigned short sfr16; +typedef volatile unsigned long sfr32; diff --git a/res/data/builtin_headers/lint_sdcc.h b/res/data/builtin_headers/lint_sdcc.h new file mode 100644 index 00000000..01875b26 --- /dev/null +++ b/res/data/builtin_headers/lint_sdcc.h @@ -0,0 +1,49 @@ +/*** + * !!! Don't include this file in your project !, it can only be used for code analysis !!! +*/ + +#ifndef __VSCODE_CPPTOOL +#error "Don't include this file in your project !, it can only be used for code analysis !" +#endif // ! + +#ifdef _WIN32 +#undef _WIN32 +#endif + +#ifdef _MSC_VER +#undef _MSC_VER +#endif + +// keywords + +#define __reentrant +#define __trap +#define __critical +#define __interrupt(x) +#define __using(x) +#define __at(x) +#define __asm__(x) +#define __naked + +// for pic + +#define __wparam +#define __shadowregs + +// storage type + +#define __data +#define __idata +#define __pdata +#define __xdata +#define __code +#define __far +#define __near + +// internal value type + +typedef _Bool __bit; +typedef volatile _Bool __sbit; +typedef volatile unsigned char __sfr; +typedef volatile unsigned short __sfr16; +typedef volatile unsigned long __sfr32; diff --git a/res/html/builder_options/js/app.js b/res/html/builder_options/js/app.js index e22138e0..23fdc891 100644 --- a/res/html/builder_options/js/app.js +++ b/res/html/builder_options/js/app.js @@ -1,2 +1,2 @@ -(function(t){function e(e){for(var s,o,n=e[0],r=e[1],c=e[2],u=0,p=[];u-1&&e.splice(a,1)}},mounted:function(){var t=this;this.$nextTick((function(){t.value?t.findAndActivateTab(t.value):t.tabs.length>0&&t.activateTab(t.tabs[0])}))},watch:{value:function(t){this.findAndActivateTab(t)}}},w=x,S=Object(m["a"])(w,c,d,!1,null,null,null),O=S.exports,j=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"show",rawName:"v-show",value:t.active,expression:"active"}],staticClass:"tab-pane fade",class:{"active show":t.active},attrs:{id:t.id||t.label,"aria-expanded":t.active}},[t._t("default")],2)},A=[],T={name:"tab-pane",props:["label","id","title"],inject:["addTab","removeTab"],data:function(){return{active:!1}},mounted:function(){this.addTab(this)},destroyed:function(){this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el),this.removeTab(this)}},P=T,B=Object(m["a"])(P,j,A,!1,null,null,null),z=B.exports,I=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a(t.tag,{tag:"component",staticClass:"btn",class:t.classes,attrs:{type:"button"===t.tag?t.nativeType:""},on:{click:t.handleClick}},[t.$slots.icon||t.icon&&t.$slots.default?a("span",{staticClass:"btn-inner--icon"},[t._t("icon",[a("i",{class:t.icon})])],2):t._e(),t.$slots.default?t._e():a("i",{class:t.icon}),t.$slots.icon||t.icon&&t.$slots.default?a("span",{staticClass:"btn-inner--text"},[t._t("default",[t._v(" "+t._s(t.text)+" ")])],2):t._e(),t.$slots.icon||t.icon?t._e():t._t("default")],2)},D=[],N=a("ade3"),W={name:"base-button",props:{tag:{type:String,default:"button",description:"Button tag (default -> button)"},type:{type:String,default:"default",description:"Button type (e,g primary, danger etc)"},size:{type:String,default:"",description:"Button size lg|sm"},textColor:{type:String,default:"",description:"Button text color (e.g primary, danger etc)"},nativeType:{type:String,default:"button",description:"Button native type (e.g submit,button etc)"},icon:{type:String,default:"",description:"Button icon"},text:{type:String,default:"",description:"Button text in case not provided via default slot"},outline:{type:Boolean,default:!1,description:"Whether button style is outline"},rounded:{type:Boolean,default:!1,description:"Whether button style is rounded"},iconOnly:{type:Boolean,default:!1,description:"Whether button contains only an icon"},block:{type:Boolean,default:!1,description:"Whether button is of block type"}},computed:{classes:function(){var t=[{"btn-block":this.block},{"rounded-circle":this.rounded},{"btn-icon-only":this.iconOnly},Object(N["a"])({},"text-".concat(this.textColor),this.textColor),{"btn-icon":this.icon||this.$slots.icon},this.type&&!this.outline?"btn-".concat(this.type):"",this.outline?"btn-outline-".concat(this.type):""];return this.size&&t.push("btn-".concat(this.size)),t}},methods:{handleClick:function(t){this.$emit("click",t)}}},E=W,F=Object(m["a"])(E,I,D,!1,null,null,null),M=F.exports,H=function(){var t,e,a,s=this,i=s.$createElement,l=s._self._c||i;return l("div",{staticClass:"card",class:[{"card-lift--hover":s.hover},{shadow:s.shadow},(t={},t["shadow-"+s.shadowSize]=s.shadowSize,t),(e={},e["bg-gradient-"+s.gradient]=s.gradient,e),(a={},a["bg-"+s.type]=s.type,a)]},[s.$slots.header?l("div",{staticClass:"card-header",class:s.headerClasses},[s._t("header")],2):s._e(),s.noBody?s._e():l("div",{staticClass:"card-body",class:s.bodyClasses},[s._t("default")],2),s.noBody?s._t("default"):s._e(),s.$slots.footer?l("div",{staticClass:"card-footer",class:s.footerClasses},[s._t("footer")],2):s._e()],2)},L=[],R={name:"card",props:{type:{type:String,description:"Card type"},gradient:{type:String,description:"Card background gradient type (warning,danger etc)"},hover:{type:Boolean,description:"Whether card should move on hover"},shadow:{type:Boolean,description:"Whether card has shadow"},shadowSize:{type:String,description:"Card shadow size"},noBody:{type:Boolean,default:!1,description:"Whether card should have wrapper body class"},bodyClasses:{type:[String,Object,Array],description:"Card body css classes"},headerClasses:{type:[String,Object,Array],description:"Card header css classes"},footerClasses:{type:[String,Object,Array],description:"Card footer css classes"}}},q=R,U=Object(m["a"])(q,H,L,!1,null,null,null),V=U.exports,J=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("SlideYUpTransition",{attrs:{duration:t.animationDuration}},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],staticClass:"modal fade",class:[{"show d-block":t.show},{"d-none":!t.show},{"modal-mini":"mini"===t.type}],attrs:{tabindex:"-1",role:"dialog","aria-hidden":!t.show},on:{click:function(e){return e.target!==e.currentTarget?null:t.closeModal(e)}}},[a("div",{staticClass:"modal-dialog modal-dialog-centered",class:[{"modal-notice":"notice"===t.type},t.modalClasses]},[a("div",{staticClass:"modal-content",class:[t.gradient?"bg-gradient-"+t.gradient:"",t.modalContentClasses]},[t.$slots.header?a("div",{staticClass:"modal-header",class:[t.headerClasses]},[t._t("header"),t._t("close-button",[t.showClose?a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"},on:{click:t.closeModal}},[a("span",{attrs:{"aria-hidden":!t.show}},[t._v("×")])]):t._e()])],2):t._e(),a("div",{staticClass:"modal-body",class:t.bodyClasses},[t._t("default")],2),t.$slots.footer?a("div",{staticClass:"modal-footer",class:t.footerClasses},[t._t("footer")],2):t._e()])])])])},Y=[],G=(a("a9e3"),a("7c76")),K={name:"modal",components:{SlideYUpTransition:G["b"]},props:{show:Boolean,showClose:{type:Boolean,default:!0},type:{type:String,default:"",validator:function(t){var e=["","notice","mini"];return-1!==e.indexOf(t)},description:'Modal type (notice|mini|"") '},modalClasses:{type:[Object,String],description:"Modal dialog css classes"},modalContentClasses:{type:[Object,String],description:"Modal dialog content css classes"},gradient:{type:String,description:"Modal gradient type (danger, primary etc)"},headerClasses:{type:[Object,String],description:"Modal Header css classes"},bodyClasses:{type:[Object,String],description:"Modal Body css classes"},footerClasses:{type:[Object,String],description:"Modal Footer css classes"},animationDuration:{type:Number,default:500,description:"Modal transition duration"}},methods:{closeModal:function(){this.$emit("update:show",!1),this.$emit("close")}},watch:{show:function(t){var e=document.body.classList;t?e.add("modal-open"):e.remove("modal-open")}}},Z=K,Q=(a("22d7"),Object(m["a"])(Z,J,Y,!1,null,null,null)),X=Q.exports,tt=(a("cd74"),{lang:"default",strs:{default:{title:"Builder Options","title.task":"User Task","title.global":"Global Options","title.c/c++":"C/C++ Compiler","title.asmber":"Assembler","title.linker":"Linker","title.task.prebuild":"Prebuild Task","title.task.posbuild":"PostBuild Task","title.task.name":"Task-{0} Name","title.task.command":"Command","title.task.options":"Options","title.task.env.name":"Variable Name","title.task.env.desc":"Description/Value","prompt.task.prebuild":"Run some shell task before build","prompt.task.posbuild":"Run some shell task after build done","prompt.task.name":"A Human-Readable Name","prompt.task.command":"Shell Command","prompt.task.disable":"Disable this command","prompt.task.aif":"Whether to skip subsequent commands if this command is failed","prompt.task.sbif":"Whether to stop building directly when this command is failed","placeholder.task.command":"Input shell commands","title.btn.add":"Add","title.btn.del":"Delete","title.btn.save":"Save All","title.btn.open.config":"Open Config","title.btn.variables":"Variables"},"zh-cn":{title:"构建器选项","title.task":"用户任务","title.global":"全局选项","title.c/c++":"C/C++ 编译器","title.asmber":"汇编器","title.linker":"链接器","title.task.prebuild":"构建前任务","title.task.posbuild":"构建后任务","title.task.name":"任务-{0} 名称","title.task.command":"命令","title.task.options":"选项","title.task.env.name":"变量名","title.task.env.desc":"描述/值","prompt.task.prebuild":"指定一些任务,将在构建开始前运行","prompt.task.posbuild":"指定一些任务,将在构建完成后运行","prompt.task.name":"用于显示的只读名称","prompt.task.command":"Shell 命令行","prompt.task.disable":"禁用该任务","prompt.task.aif":"如果失败,则跳过后续命令","prompt.task.sbif":"如果失败,则停止构建","placeholder.task.command":"输入 Shell 命令行","title.btn.add":"添加","title.btn.del":"删除","title.btn.save":"全部保存","title.btn.open.config":"打开配置","title.btn.variables":"变量"}},style:{textarea:"font-family: Consolas",input:"min-height: 43px; height: 43px;"},textarea:{autosize:{minRows:2}},dialog:{title:"",msg:"",visible:!1,theme:"success"},location:{tooltip:{title:"top",options:"right"}},prjEnvList:[],contextData:{},task:{before:[],after:[]},global:[],cpp:[],asm:[],linker:[]}),et={name:"App",components:{Tabs:O,TabPane:z,BaseButton:M,Card:V,Modal:X},data:function(){return tt},mounted:function(){var t=this;s=this,this.$on("save-status",(function(e){t.dialog.title=e.title||t.title,t.dialog.msg=e.msg,t.dialog.theme=e.success?"success":"danger",t.dialog.visible=!0}))},methods:{getInstance:function(){return s},forceUpdate:function(){this.$forceUpdate()},onSave:function(){s.$emit("save-all")},onOpenConfig:function(){s.$emit("open-config")},notify:function(t){s.$notify(t)},message:function(t){s.$message(t)},get_str:function(t){return this.strs[this.lang]&&void 0!==this.strs[this.lang][t]?this.strs[this.lang][t]:this.strs["default"][t]||t},query_input_auto_complete_list:function(t,e,a){if(this.contextData[a]){var s=this.contextData[a].filter((function(e){return e.includes(t)})).map((function(t){return{value:t}}));e(s)}},add_prebuild_task:function(){this.task.before.push({name:"new prebuild task",disable:!1,abortAfterFailed:!1,stopBuildAfterFailed:!0,command:'echo "project name: ${ProjectName}"'})},delete_prebuild_task:function(t){var e=this.task.before.findIndex((function(e){return e.name==t.name&&e.command==t.command}));-1!=e&&this.task.before.splice(e,1)},add_postbuild_task:function(){this.task.after.push({name:"new postbuild task",disable:!1,abortAfterFailed:!1,command:'echo "firmware: ${OutDir}/${ProjectName}.hex"'})},delete_postbuild_task:function(t){var e=this.task.after.findIndex((function(e){return e.name==t.name&&e.command==t.command}));-1!=e&&this.task.after.splice(e,1)},add_to_list:function(t,e){void 0!=e&&null!=e&&("object"==Object(r["a"])(e)?t.push({value:JSON.parse(JSON.stringify(e))}):t.push({value:e}))},delete_from_list:function(t,e){var a=t.findIndex((function(t){return t.value==e}));-1!=a&&t.splice(a,1)},get_readable_name:function(t){return t.disable_readable_name?this.to_readable_name(t.name):t.readable_name||t.description||this.to_readable_name(t.name)},to_readable_name:function(t){var e,a=t.replace(/-/g," ").replace(/#/g,"/").replace(/\$/g,""),s="",l="",o=function(t){return t>="a"&&t<="z"},n=function(t){return t>="A"&&t<="Z"},r=Object(i["a"])(a);try{for(r.s();!(e=r.n()).done;){var c=e.value;n(c)&&o(l)&&(s+=" "),s+=c,l=c}}catch(d){r.e(d)}finally{r.f()}return s},get_rows_by_value:function(t){var e=t.length/60+(t.length%60>0);return e||1}}};$((function(){$('[data-toggle="popover"]').popover()})),$((function(){$('[data-toggle="tooltip"]').tooltip()}));var at=et,st=(a("034f"),Object(m["a"])(at,o,n,!1,null,null,null)),it=st.exports,lt=(a("4d1c"),a("d5a0"),a("a4d4"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a(t.tag,{tag:"component",staticClass:"badge",class:["badge-"+t.type,t.rounded?"badge-pill":"",t.circle&&"badge-circle"]},[t._t("default",[t.icon?a("i",{class:t.icon}):t._e()])],2)}),ot=[],nt={name:"badge",props:{tag:{type:String,default:"span",description:"Html tag to use for the badge."},rounded:{type:Boolean,default:!1,description:"Whether badge is of pill type"},circle:{type:Boolean,default:!1,description:"Whether badge is circle"},icon:{type:String,default:"",description:"Icon name. Will be overwritten by slot if slot is used"},type:{type:String,default:"default",description:"Badge type (primary|info|danger|default|warning|success)"}}},rt=nt,ct=Object(m["a"])(rt,lt,ot,!1,null,null,null),dt=ct.exports,ut=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("fade-transition",[t.visible?a("div",{staticClass:"alert",class:["alert-"+t.type,{"alert-dismissible":t.dismissible}],attrs:{role:"alert"}},[t.dismissible?[t._t("default",[t.icon?a("span",{staticClass:"alert-inner--icon"},[a("i",{class:t.icon})]):t._e(),t.$slots.text?a("span",{staticClass:"alert-inner--text"},[t._t("text")],2):t._e()]),t._t("dismiss-icon",[a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"alert","aria-label":"Close"},on:{click:t.dismissAlert}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])])]:t._t("default",[t.icon?a("span",{staticClass:"alert-inner--icon"},[a("i",{class:t.icon})]):t._e(),t.$slots.text?a("span",{staticClass:"alert-inner--text"},[t._t("text")],2):t._e()])],2):t._e()])},pt=[],mt={name:"base-alert",components:{FadeTransition:G["a"]},props:{type:{type:String,default:"default",description:"Alert type"},icon:{type:String,default:"",description:"Alert icon. Will be overwritten by default slot"},dismissible:{type:Boolean,default:!1,description:"Whether alert is closes when clicking"}},data:function(){return{visible:!0}},methods:{dismissAlert:function(){this.visible=!1}}},vt=mt,ft=Object(m["a"])(vt,ut,pt,!1,null,null,null),bt=ft.exports,gt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"custom-control custom-checkbox",class:[{disabled:t.disabled},t.inlineClass]},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"custom-control-input",attrs:{id:t.cbId,type:"checkbox",disabled:t.disabled},domProps:{checked:Array.isArray(t.model)?t._i(t.model,null)>-1:t.model},on:{change:function(e){var a=t.model,s=e.target,i=!!s.checked;if(Array.isArray(a)){var l=null,o=t._i(a,l);s.checked?o<0&&(t.model=a.concat([l])):o>-1&&(t.model=a.slice(0,o).concat(a.slice(o+1)))}else t.model=i}}}),a("label",{staticClass:"custom-control-label",attrs:{for:t.cbId}},[t._t("default",[t.inline?a("span"):t._e()])],2)])},ht=[];function _t(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",a="",s=0;s0?this.pageCount:this.total>0?Math.ceil(this.total/this.perPage):1},pagesToDisplay:function(){return this.totalPages>0&&this.totalPages=this.pagesToDisplay){var t=Math.floor(this.pagesToDisplay/2),e=t+this.value;return e>this.totalPages?this.totalPages-this.pagesToDisplay+1:this.value-t}return 1},maxPage:function(){if(this.value>=this.pagesToDisplay){var t=Math.floor(this.pagesToDisplay/2),e=t+this.value;return e1&&this.$emit("input",this.value-1)}},watch:{perPage:function(){this.$emit("input",1)},total:function(){this.$emit("input",1)}}},It=zt,Dt=Object(m["a"])(It,Pt,Bt,!1,null,null,null),Nt=Dt.exports,Wt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"progress-wrapper"},[a("div",{class:"progress-"+t.type},[a("div",{staticClass:"progress-label"},[t._t("label",[a("span",[t._v(t._s(t.label))])])],2),a("div",{staticClass:"progress-percentage"},[t._t("default",[a("span",[t._v(t._s(t.value)+"%")])])],2)]),a("div",{staticClass:"progress",style:"height: "+t.height+"px"},[a("div",{staticClass:"progress-bar",class:t.computedClasses,style:"width: "+t.value+"%;",attrs:{role:"progressbar","aria-valuenow":t.value,"aria-valuemin":"0","aria-valuemax":"100"}})])])},Et=[],Ft={name:"base-progress",props:{striped:{type:Boolean,description:"Whether progress is striped"},animated:{type:Boolean,description:"Whether progress is animated (works only with `striped` prop together)"},label:{type:String,description:"Progress label (shown on the left above progress)"},height:{type:Number,default:8,description:"Progress line height"},type:{type:String,default:"default",description:"Progress type (e.g danger, primary etc)"},value:{type:Number,default:0,validator:function(t){return t>=0&&t<=100},description:"Progress value"}},computed:{computedClasses:function(){return[{"progress-bar-striped":this.striped},{"progress-bar-animated":this.animated},Object(N["a"])({},"bg-".concat(this.type),this.type)]}}},Mt=Ft,Ht=Object(m["a"])(Mt,Wt,Et,!1,null,null,null),Lt=Ht.exports,Rt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"custom-control custom-radio",class:[t.inlineClass,{disabled:t.disabled}]},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"custom-control-input",attrs:{id:t.cbId,type:"radio",disabled:t.disabled},domProps:{value:t.name,checked:t._q(t.model,t.name)},on:{change:function(e){t.model=t.name}}}),a("label",{staticClass:"custom-control-label",attrs:{for:t.cbId}},[t._t("default")],2)])},qt=[],Ut={name:"base-radio",props:{name:{type:[String,Number],description:"Radio label"},disabled:{type:Boolean,description:"Whether radio is disabled"},value:{type:[String,Boolean],description:"Radio value"},inline:{type:Boolean,description:"Whether radio is inline"}},data:function(){return{cbId:""}},computed:{model:{get:function(){return this.value},set:function(t){this.$emit("input",t)}},inlineClass:function(){return this.inline?"form-check-inline":""}},mounted:function(){this.cbId=_t()}},Vt=Ut,Jt=Object(m["a"])(Vt,Rt,qt,!1,null,null,null),Yt=Jt.exports,Gt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"input-slider-container"},[a("div",{ref:"slider",staticClass:"input-slider",class:["slider-"+t.type],attrs:{disabled:t.disabled}})])},Kt=[],Zt=a("e9fa"),Qt=a.n(Zt),Xt={name:"base-slider",props:{value:{type:[String,Array,Number],description:"Slider value"},disabled:{type:Boolean,description:"Whether slider is disabled"},range:{type:Object,default:function(){return{min:0,max:100}},description:"Slider range (defaults to 0-100)"},type:{type:String,default:"",description:"Slider type (e.g primary, danger etc)"},options:{type:Object,default:function(){return{}},description:"noUiSlider options"}},computed:{connect:function(){return Array.isArray(this.value)||[!0,!1]}},data:function(){return{slider:null}},methods:{createSlider:function(){var t=this;Qt.a.create(this.$refs.slider,Object(St["a"])({start:this.value,connect:this.connect,range:this.range},this.options));var e=this.$refs.slider.noUiSlider;e.on("slide",(function(){var a=e.get();a!==t.value&&t.$emit("input",a)}))}},mounted:function(){this.createSlider()},watch:{value:function(t,e){var a=this.$refs.slider.noUiSlider,s=a.get();t!==e&&s!==t&&(Array.isArray(s)&&Array.isArray(t)?e.length===t.length&&e.every((function(e,a){return e===t[a]}))&&a.set(t):a.set(t))}}},te=Xt,ee=Object(m["a"])(te,Gt,Kt,!1,null,null,null),ae=ee.exports,se=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("label",{staticClass:"custom-toggle"},[a("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.model)?t._i(t.model,null)>-1:t.model},on:{change:function(e){var a=t.model,s=e.target,i=!!s.checked;if(Array.isArray(a)){var l=null,o=t._i(a,l);s.checked?o<0&&(t.model=a.concat([l])):o>-1&&(t.model=a.slice(0,o).concat(a.slice(o+1)))}else t.model=i}}},"input",t.$attrs,!1),t.$listeners)),a("span",{staticClass:"custom-toggle-slider rounded-circle"})])},ie=[],le={name:"base-switch",inheritAttrs:!1,props:{value:{type:Boolean,default:!1,description:"Switch value"}},computed:{model:{get:function(){return this.value},set:function(t){this.$emit("input",t)}}}},oe=le,ne=Object(m["a"])(oe,se,ie,!1,null,null,null),re=ne.exports,ce=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"icon icon-shape",class:[t.size&&"icon-"+t.size,t.type&&"icon-shape-"+t.type,t.gradient&&"bg-gradient-"+t.gradient,t.shadow&&"shadow",t.rounded&&"rounded-circle",t.color&&"text-"+t.color]},[t._t("default",[a("i",{class:t.name})])],2)},de=[],ue={name:"icon",props:{name:{type:String,default:"",description:"Icon name"},size:{type:String,default:"",description:"Icon size"},type:{type:String,default:"",description:"Icon type (primary, warning etc)"},gradient:{type:String,default:"",description:"Icon gradient type (primary, warning etc)"},color:{type:String,default:"",description:"Icon color (primary, warning etc)"},shadow:{type:Boolean,default:!1,description:"Whether icon has shadow"},rounded:{type:Boolean,default:!1,description:"Whether icon is rounded"}}},pe=ue,me=Object(m["a"])(pe,ce,de,!1,null,null,null),ve=me.exports,fe={install:function(t){t.component(dt.name,dt),t.component(bt.name,bt),t.component(M.name,M),t.component(Tt.name,Tt),t.component(xt.name,xt),t.component(Nt.name,Nt),t.component(Lt.name,Lt),t.component(Yt.name,Yt),t.component(ae.name,ae),t.component(re.name,re),t.component(V.name,V),t.component(ve.name,ve)}},be={bind:function(t,e,a){t.clickOutsideEvent=function(s){t==s.target||t.contains(s.target)||a.context[e.expression](s)},document.body.addEventListener("click",t.clickOutsideEvent)},unbind:function(t){document.body.removeEventListener("click",t.clickOutsideEvent)}},ge={install:function(t){t.directive("click-outside",be)}},he=ge,_e=a("caf9"),ye={install:function(t){t.use(fe),t.use(he),t.use(_e["a"])}},Ce=a("5c96"),ke=a.n(Ce);a("0fae");l["default"].config.productionTip=!1,l["default"].use(ye),l["default"].use(ke.a);var xe=void 0,we=void 0,$e=!1,Se=it.data(),Oe=acquireVsCodeApi();function je(){$e||($e=!0,console.log("[builder options view] start init and create page ..."),new l["default"]({render:function(t){return t(it)}}).$mount("#app"),xe=it.methods.getInstance(),xe.$on("save-all",(function(){return Te()})),xe.$on("open-config",(function(){return Oe.postMessage("open-config")})),console.log("[builder options view] app inited done !"))}function Ae(t){it.methods.notify({type:t.success?"success":"error",title:t.success?"Success":"Failed",message:t.msg,position:"bottom-right"})}function Te(){if(xe){console.log("[builder options view] start post data ...");var t={before:"beforeBuildTasks",after:"afterBuildTasks"};for(var e in t){var a=xe.task[e];we[t[e]]=a}var s={global:"global",cpp:"c/cpp-compiler",asm:"asm-compiler",linker:"linker"};for(var l in s){var o,n=xe[l],r=we[s[l]],c=Object(i["a"])(n);try{for(c.s();!(o=c.n()).done;){var d=o.value;switch(d.type){case"array":d.value.length>0?r[d.name]=d.value.map((function(t){return t.value})):delete r[d.name];break;case"bool":d.value?r[d.name]=d.value:delete r[d.name];break;default:"string"==typeof d.value&&""==d.value.trim()?delete r[d.name]:r[d.name]=d.value;break}"string"==typeof r[d.name]&&(r[d.name]=r[d.name].replace(/\r\n|\n/g," ").replace(/\s{2,}/g," ").trim())}}catch(u){c.e(u)}finally{c.f()}}Oe.postMessage(we),console.log("[builder options view] post data done !")}else Ae({success:!1,msg:"App have not inited !"})}function Pe(t,e){var a,s=e.split("/"),l=t,o=Object(i["a"])(s);try{for(o.s();!(a=o.n()).done;){var n=a.value;if(""!=n){if(void 0==l)break;l=l[n]}}}catch(r){o.e(r)}finally{o.f()}return l}function Be(t,e){if(e["$ref"]){var a=Pe(t,e["$ref"].replace("#/",""));for(var s in a)void 0===e[s]&&(e[s]=a[s])}return e}function ze(t){return"huge"==t["size"]?"textarea":"small"==t["size"]?"short_input":Array.isArray(t.type)?"string":t.type}function Ie(t,e,a){var s=ze(t);switch(e.description=t.markdownDescription||t.description,De&&t["description.".concat(De)]&&(e.description=t["description.".concat(De)]),e.disable_readable_name=t.disable_readable_name,e.readable_name=t.readable_name,De&&t["readable_name.".concat(De)]&&(e.readable_name=t["readable_name.".concat(De)]),e.auto_complete_ctx=t["auto_complete_ctx"],s){case"array":e.type=s;break;case"boolean":e.type="bool";break;case"string":t["enum"]?(e.type="enum",e.enums=t["enum"],e.enumDesc=t["enumDescriptions"]||[]):(e.type="input",e.placeHolder=e.description);break;case"short_input":case"textarea":e.type=s,e.placeHolder=e.description;break;default:return console.warn("[builder options view] [warn] not support this type: '".concat(s,"' for field !")),!1}if("array"==s&&t.items)if(e.child_type=t.items.type,"string"==e.child_type)e.child_def_val=t.items.default||"",t.items["enum"]&&(e.enums=t.items["enum"],e.enumDesc=t.items["enumDescriptions"]||[]);else if("object"==e.child_type)for(var i in e.child_def_val={},e.child_key_meta={},t.items.properties)e.child_def_val[i]=t.items.properties[i].default,e.child_key_meta[i]=t.items.properties[i];if(a)switch(s){case"array":e.value=(Array.isArray(a)?a:[a]).map((function(t){return{value:t}}));break;case"boolean":e.value=a;break;default:e.value=Array.isArray(a)?a.join(" "):a;break}else"bool"==e.type?e.value=!1:"enum"==e.type?e.value=t.default||"":"array"==e.type?e.value=[]:e.value="";return!0}window.addEventListener("message",(function(t){if(t.data.status){var e={success:t.data.status.success,msg:t.data.status.msg};Ae(e)}else we=t.data.data,Ne(t.data.model,we,t.data.info),je()})),document.addEventListener("keydown",(function(t){"s"==t.key.toLowerCase()&&t.ctrlKey&&(t.preventDefault(),Te())})),Oe.postMessage("eide.options_view.launched");var De=void 0;function Ne(t,e,a){console.log("[builder options view] start init data ...");var s=t.properties,l={global:"global",cpp:"c/cpp-compiler",asm:"asm-compiler",linker:"linker"};for(var o in a&&(De=a.lang,Se.lang=De,Se.prjEnvList=a.envList,Se.contextData=a.contextData||{}),l){var n=s[l[o]].properties,r=e[l[o]],c=Se[o];for(var d in n){var u=Be(t,n[d]),p={name:d};Ie(u,p,r[d])&&c.push(p)}}var m={before:"beforeBuildTasks",after:"afterBuildTasks"};for(var v in m){var f=Se.task[v],b=e[m[v]];if(b&&Array.isArray(b)){var g,h=Object(i["a"])(b);try{for(h.s();!(g=h.n()).done;){var _=g.value;f.push(_)}}catch(y){h.e(y)}finally{h.f()}}}console.log("[builder options view] Init data done !")}},"85ec":function(t,e,a){},a4d4:function(t,e,a){},be87:function(t,e,a){},d5a0:function(t,e,a){}}); +(function(t){function e(e){for(var s,o,n=e[0],r=e[1],c=e[2],u=0,p=[];u-1&&e.splice(a,1)}},mounted:function(){var t=this;this.$nextTick((function(){t.value?t.findAndActivateTab(t.value):t.tabs.length>0&&t.activateTab(t.tabs[0])}))},watch:{value:function(t){this.findAndActivateTab(t)}}},w=x,S=Object(m["a"])(w,c,d,!1,null,null,null),O=S.exports,j=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"show",rawName:"v-show",value:t.active,expression:"active"}],staticClass:"tab-pane fade",class:{"active show":t.active},attrs:{id:t.id||t.label,"aria-expanded":t.active}},[t._t("default")],2)},A=[],T={name:"tab-pane",props:["label","id","title"],inject:["addTab","removeTab"],data:function(){return{active:!1}},mounted:function(){this.addTab(this)},destroyed:function(){this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el),this.removeTab(this)}},P=T,B=Object(m["a"])(P,j,A,!1,null,null,null),z=B.exports,I=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a(t.tag,{tag:"component",staticClass:"btn",class:t.classes,attrs:{type:"button"===t.tag?t.nativeType:""},on:{click:t.handleClick}},[t.$slots.icon||t.icon&&t.$slots.default?a("span",{staticClass:"btn-inner--icon"},[t._t("icon",[a("i",{class:t.icon})])],2):t._e(),t.$slots.default?t._e():a("i",{class:t.icon}),t.$slots.icon||t.icon&&t.$slots.default?a("span",{staticClass:"btn-inner--text"},[t._t("default",[t._v(" "+t._s(t.text)+" ")])],2):t._e(),t.$slots.icon||t.icon?t._e():t._t("default")],2)},D=[],N=a("ade3"),W={name:"base-button",props:{tag:{type:String,default:"button",description:"Button tag (default -> button)"},type:{type:String,default:"default",description:"Button type (e,g primary, danger etc)"},size:{type:String,default:"",description:"Button size lg|sm"},textColor:{type:String,default:"",description:"Button text color (e.g primary, danger etc)"},nativeType:{type:String,default:"button",description:"Button native type (e.g submit,button etc)"},icon:{type:String,default:"",description:"Button icon"},text:{type:String,default:"",description:"Button text in case not provided via default slot"},outline:{type:Boolean,default:!1,description:"Whether button style is outline"},rounded:{type:Boolean,default:!1,description:"Whether button style is rounded"},iconOnly:{type:Boolean,default:!1,description:"Whether button contains only an icon"},block:{type:Boolean,default:!1,description:"Whether button is of block type"}},computed:{classes:function(){var t=[{"btn-block":this.block},{"rounded-circle":this.rounded},{"btn-icon-only":this.iconOnly},Object(N["a"])({},"text-".concat(this.textColor),this.textColor),{"btn-icon":this.icon||this.$slots.icon},this.type&&!this.outline?"btn-".concat(this.type):"",this.outline?"btn-outline-".concat(this.type):""];return this.size&&t.push("btn-".concat(this.size)),t}},methods:{handleClick:function(t){this.$emit("click",t)}}},E=W,F=Object(m["a"])(E,I,D,!1,null,null,null),M=F.exports,H=function(){var t,e,a,s=this,i=s.$createElement,l=s._self._c||i;return l("div",{staticClass:"card",class:[{"card-lift--hover":s.hover},{shadow:s.shadow},(t={},t["shadow-"+s.shadowSize]=s.shadowSize,t),(e={},e["bg-gradient-"+s.gradient]=s.gradient,e),(a={},a["bg-"+s.type]=s.type,a)]},[s.$slots.header?l("div",{staticClass:"card-header",class:s.headerClasses},[s._t("header")],2):s._e(),s.noBody?s._e():l("div",{staticClass:"card-body",class:s.bodyClasses},[s._t("default")],2),s.noBody?s._t("default"):s._e(),s.$slots.footer?l("div",{staticClass:"card-footer",class:s.footerClasses},[s._t("footer")],2):s._e()],2)},L=[],R={name:"card",props:{type:{type:String,description:"Card type"},gradient:{type:String,description:"Card background gradient type (warning,danger etc)"},hover:{type:Boolean,description:"Whether card should move on hover"},shadow:{type:Boolean,description:"Whether card has shadow"},shadowSize:{type:String,description:"Card shadow size"},noBody:{type:Boolean,default:!1,description:"Whether card should have wrapper body class"},bodyClasses:{type:[String,Object,Array],description:"Card body css classes"},headerClasses:{type:[String,Object,Array],description:"Card header css classes"},footerClasses:{type:[String,Object,Array],description:"Card footer css classes"}}},q=R,U=Object(m["a"])(q,H,L,!1,null,null,null),V=U.exports,J=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("SlideYUpTransition",{attrs:{duration:t.animationDuration}},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],staticClass:"modal fade",class:[{"show d-block":t.show},{"d-none":!t.show},{"modal-mini":"mini"===t.type}],attrs:{tabindex:"-1",role:"dialog","aria-hidden":!t.show},on:{click:function(e){return e.target!==e.currentTarget?null:t.closeModal(e)}}},[a("div",{staticClass:"modal-dialog modal-dialog-centered",class:[{"modal-notice":"notice"===t.type},t.modalClasses]},[a("div",{staticClass:"modal-content",class:[t.gradient?"bg-gradient-"+t.gradient:"",t.modalContentClasses]},[t.$slots.header?a("div",{staticClass:"modal-header",class:[t.headerClasses]},[t._t("header"),t._t("close-button",[t.showClose?a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"},on:{click:t.closeModal}},[a("span",{attrs:{"aria-hidden":!t.show}},[t._v("×")])]):t._e()])],2):t._e(),a("div",{staticClass:"modal-body",class:t.bodyClasses},[t._t("default")],2),t.$slots.footer?a("div",{staticClass:"modal-footer",class:t.footerClasses},[t._t("footer")],2):t._e()])])])])},Y=[],G=(a("a9e3"),a("7c76")),K={name:"modal",components:{SlideYUpTransition:G["b"]},props:{show:Boolean,showClose:{type:Boolean,default:!0},type:{type:String,default:"",validator:function(t){var e=["","notice","mini"];return-1!==e.indexOf(t)},description:'Modal type (notice|mini|"") '},modalClasses:{type:[Object,String],description:"Modal dialog css classes"},modalContentClasses:{type:[Object,String],description:"Modal dialog content css classes"},gradient:{type:String,description:"Modal gradient type (danger, primary etc)"},headerClasses:{type:[Object,String],description:"Modal Header css classes"},bodyClasses:{type:[Object,String],description:"Modal Body css classes"},footerClasses:{type:[Object,String],description:"Modal Footer css classes"},animationDuration:{type:Number,default:500,description:"Modal transition duration"}},methods:{closeModal:function(){this.$emit("update:show",!1),this.$emit("close")}},watch:{show:function(t){var e=document.body.classList;t?e.add("modal-open"):e.remove("modal-open")}}},Z=K,Q=(a("22d7"),Object(m["a"])(Z,J,Y,!1,null,null,null)),X=Q.exports,tt=(a("cd74"),{lang:"default",strs:{default:{title:"Builder Options","title.task":"User Task","title.global":"Global Options","title.c/c++":"C/C++ Compiler","title.asmber":"Assembler","title.linker":"Linker","title.task.prebuild":"Prebuild Task","title.task.posbuild":"PostBuild Task","title.task.name":"Task-{0} Name","title.task.command":"Command","title.task.options":"Options","title.task.env.name":"Variable Name","title.task.env.desc":"Description/Value","prompt.task.prebuild":"Run some shell task before build","prompt.task.posbuild":"Run some shell task after build done","prompt.task.name":"A Human-Readable Name","prompt.task.command":"Shell Command","prompt.task.disable":"Disable this command","prompt.task.aif":"Whether to skip subsequent commands if this command is failed","prompt.task.sbif":"Whether to stop building directly when this command is failed","placeholder.task.command":"Input shell commands","title.btn.add":"Add","title.btn.del":"Delete","title.btn.save":"Save All","title.btn.open.config":"Open Config","title.btn.variables":"Variables"},"zh-cn":{title:"构建器选项","title.task":"用户任务","title.global":"全局选项","title.c/c++":"C/C++ 编译器","title.asmber":"汇编器","title.linker":"链接器","title.task.prebuild":"构建前任务","title.task.posbuild":"构建后任务","title.task.name":"任务-{0} 名称","title.task.command":"命令","title.task.options":"选项","title.task.env.name":"变量名","title.task.env.desc":"描述/值","prompt.task.prebuild":"指定一些任务,将在构建开始前运行","prompt.task.posbuild":"指定一些任务,将在构建完成后运行","prompt.task.name":"用于显示的只读名称","prompt.task.command":"Shell 命令行","prompt.task.disable":"禁用该任务","prompt.task.aif":"如果失败,则跳过后续命令","prompt.task.sbif":"如果失败,则停止构建","placeholder.task.command":"输入 Shell 命令行","title.btn.add":"添加","title.btn.del":"删除","title.btn.save":"全部保存","title.btn.open.config":"打开配置","title.btn.variables":"变量"}},style:{textarea:"font-family: Consolas",input:"min-height: 43px; height: 43px;"},textarea:{autosize:{minRows:2}},dialog:{title:"",msg:"",visible:!1,theme:"success"},location:{tooltip:{title:"top",options:"right"}},prjEnvList:[],contextData:{},task:{before:[],after:[]},global:[],cpp:[],asm:[],linker:[]}),et={name:"App",components:{Tabs:O,TabPane:z,BaseButton:M,Card:V,Modal:X},data:function(){return tt},mounted:function(){var t=this;s=this,this.$on("save-status",(function(e){t.dialog.title=e.title||t.title,t.dialog.msg=e.msg,t.dialog.theme=e.success?"success":"danger",t.dialog.visible=!0}))},methods:{getInstance:function(){return s},forceUpdate:function(){this.$forceUpdate()},onSave:function(){s.$emit("save-all")},onOpenConfig:function(){s.$emit("open-config")},notify:function(t){s.$notify(t)},message:function(t){s.$message(t)},get_str:function(t){return this.strs[this.lang]&&void 0!==this.strs[this.lang][t]?this.strs[this.lang][t]:this.strs["default"][t]||t},query_input_auto_complete_list:function(t,e,a){if(this.contextData[a]){var s=this.contextData[a].filter((function(e){return e.includes(t)})).map((function(t){return{value:t}}));e(s)}},add_prebuild_task:function(){this.task.before.push({name:"new prebuild task",disable:!1,abortAfterFailed:!1,stopBuildAfterFailed:!0,command:'echo "project name: ${ProjectName}"'})},delete_prebuild_task:function(t){var e=this.task.before.findIndex((function(e){return e.name==t.name&&e.command==t.command}));-1!=e&&this.task.before.splice(e,1)},add_postbuild_task:function(){this.task.after.push({name:"new postbuild task",disable:!1,abortAfterFailed:!1,command:'echo "firmware: ${OutDir}/${ProjectName}.hex"'})},delete_postbuild_task:function(t){var e=this.task.after.findIndex((function(e){return e.name==t.name&&e.command==t.command}));-1!=e&&this.task.after.splice(e,1)},add_to_list:function(t,e){void 0!=e&&null!=e&&("object"==Object(r["a"])(e)?t.push({value:JSON.parse(JSON.stringify(e))}):t.push({value:e}))},delete_from_list:function(t,e){var a=t.findIndex((function(t){return t.value==e}));-1!=a&&t.splice(a,1)},get_readable_name:function(t){return t.disable_readable_name?this.to_readable_name(t.name):t.readable_name||t.description||this.to_readable_name(t.name)},to_readable_name:function(t){var e,a=t.replace(/-/g," ").replace(/#/g,"/").replace(/\$/g,""),s="",l="",o=function(t){return t>="a"&&t<="z"},n=function(t){return t>="A"&&t<="Z"},r=Object(i["a"])(a);try{for(r.s();!(e=r.n()).done;){var c=e.value;n(c)&&o(l)&&(s+=" "),s+=c,l=c}}catch(d){r.e(d)}finally{r.f()}return s},get_rows_by_value:function(t){var e=t.length/60+(t.length%60>0);return e||1}}};$((function(){$('[data-toggle="popover"]').popover()})),$((function(){$('[data-toggle="tooltip"]').tooltip()}));var at=et,st=(a("034f"),Object(m["a"])(at,o,n,!1,null,null,null)),it=st.exports,lt=(a("4d1c"),a("d5a0"),a("a4d4"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a(t.tag,{tag:"component",staticClass:"badge",class:["badge-"+t.type,t.rounded?"badge-pill":"",t.circle&&"badge-circle"]},[t._t("default",[t.icon?a("i",{class:t.icon}):t._e()])],2)}),ot=[],nt={name:"badge",props:{tag:{type:String,default:"span",description:"Html tag to use for the badge."},rounded:{type:Boolean,default:!1,description:"Whether badge is of pill type"},circle:{type:Boolean,default:!1,description:"Whether badge is circle"},icon:{type:String,default:"",description:"Icon name. Will be overwritten by slot if slot is used"},type:{type:String,default:"default",description:"Badge type (primary|info|danger|default|warning|success)"}}},rt=nt,ct=Object(m["a"])(rt,lt,ot,!1,null,null,null),dt=ct.exports,ut=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("fade-transition",[t.visible?a("div",{staticClass:"alert",class:["alert-"+t.type,{"alert-dismissible":t.dismissible}],attrs:{role:"alert"}},[t.dismissible?[t._t("default",[t.icon?a("span",{staticClass:"alert-inner--icon"},[a("i",{class:t.icon})]):t._e(),t.$slots.text?a("span",{staticClass:"alert-inner--text"},[t._t("text")],2):t._e()]),t._t("dismiss-icon",[a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"alert","aria-label":"Close"},on:{click:t.dismissAlert}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])])]:t._t("default",[t.icon?a("span",{staticClass:"alert-inner--icon"},[a("i",{class:t.icon})]):t._e(),t.$slots.text?a("span",{staticClass:"alert-inner--text"},[t._t("text")],2):t._e()])],2):t._e()])},pt=[],mt={name:"base-alert",components:{FadeTransition:G["a"]},props:{type:{type:String,default:"default",description:"Alert type"},icon:{type:String,default:"",description:"Alert icon. Will be overwritten by default slot"},dismissible:{type:Boolean,default:!1,description:"Whether alert is closes when clicking"}},data:function(){return{visible:!0}},methods:{dismissAlert:function(){this.visible=!1}}},vt=mt,ft=Object(m["a"])(vt,ut,pt,!1,null,null,null),bt=ft.exports,gt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"custom-control custom-checkbox",class:[{disabled:t.disabled},t.inlineClass]},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"custom-control-input",attrs:{id:t.cbId,type:"checkbox",disabled:t.disabled},domProps:{checked:Array.isArray(t.model)?t._i(t.model,null)>-1:t.model},on:{change:function(e){var a=t.model,s=e.target,i=!!s.checked;if(Array.isArray(a)){var l=null,o=t._i(a,l);s.checked?o<0&&(t.model=a.concat([l])):o>-1&&(t.model=a.slice(0,o).concat(a.slice(o+1)))}else t.model=i}}}),a("label",{staticClass:"custom-control-label",attrs:{for:t.cbId}},[t._t("default",[t.inline?a("span"):t._e()])],2)])},ht=[];function _t(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",a="",s=0;s0?this.pageCount:this.total>0?Math.ceil(this.total/this.perPage):1},pagesToDisplay:function(){return this.totalPages>0&&this.totalPages=this.pagesToDisplay){var t=Math.floor(this.pagesToDisplay/2),e=t+this.value;return e>this.totalPages?this.totalPages-this.pagesToDisplay+1:this.value-t}return 1},maxPage:function(){if(this.value>=this.pagesToDisplay){var t=Math.floor(this.pagesToDisplay/2),e=t+this.value;return e1&&this.$emit("input",this.value-1)}},watch:{perPage:function(){this.$emit("input",1)},total:function(){this.$emit("input",1)}}},It=zt,Dt=Object(m["a"])(It,Pt,Bt,!1,null,null,null),Nt=Dt.exports,Wt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"progress-wrapper"},[a("div",{class:"progress-"+t.type},[a("div",{staticClass:"progress-label"},[t._t("label",[a("span",[t._v(t._s(t.label))])])],2),a("div",{staticClass:"progress-percentage"},[t._t("default",[a("span",[t._v(t._s(t.value)+"%")])])],2)]),a("div",{staticClass:"progress",style:"height: "+t.height+"px"},[a("div",{staticClass:"progress-bar",class:t.computedClasses,style:"width: "+t.value+"%;",attrs:{role:"progressbar","aria-valuenow":t.value,"aria-valuemin":"0","aria-valuemax":"100"}})])])},Et=[],Ft={name:"base-progress",props:{striped:{type:Boolean,description:"Whether progress is striped"},animated:{type:Boolean,description:"Whether progress is animated (works only with `striped` prop together)"},label:{type:String,description:"Progress label (shown on the left above progress)"},height:{type:Number,default:8,description:"Progress line height"},type:{type:String,default:"default",description:"Progress type (e.g danger, primary etc)"},value:{type:Number,default:0,validator:function(t){return t>=0&&t<=100},description:"Progress value"}},computed:{computedClasses:function(){return[{"progress-bar-striped":this.striped},{"progress-bar-animated":this.animated},Object(N["a"])({},"bg-".concat(this.type),this.type)]}}},Mt=Ft,Ht=Object(m["a"])(Mt,Wt,Et,!1,null,null,null),Lt=Ht.exports,Rt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"custom-control custom-radio",class:[t.inlineClass,{disabled:t.disabled}]},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"custom-control-input",attrs:{id:t.cbId,type:"radio",disabled:t.disabled},domProps:{value:t.name,checked:t._q(t.model,t.name)},on:{change:function(e){t.model=t.name}}}),a("label",{staticClass:"custom-control-label",attrs:{for:t.cbId}},[t._t("default")],2)])},qt=[],Ut={name:"base-radio",props:{name:{type:[String,Number],description:"Radio label"},disabled:{type:Boolean,description:"Whether radio is disabled"},value:{type:[String,Boolean],description:"Radio value"},inline:{type:Boolean,description:"Whether radio is inline"}},data:function(){return{cbId:""}},computed:{model:{get:function(){return this.value},set:function(t){this.$emit("input",t)}},inlineClass:function(){return this.inline?"form-check-inline":""}},mounted:function(){this.cbId=_t()}},Vt=Ut,Jt=Object(m["a"])(Vt,Rt,qt,!1,null,null,null),Yt=Jt.exports,Gt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"input-slider-container"},[a("div",{ref:"slider",staticClass:"input-slider",class:["slider-"+t.type],attrs:{disabled:t.disabled}})])},Kt=[],Zt=a("e9fa"),Qt=a.n(Zt),Xt={name:"base-slider",props:{value:{type:[String,Array,Number],description:"Slider value"},disabled:{type:Boolean,description:"Whether slider is disabled"},range:{type:Object,default:function(){return{min:0,max:100}},description:"Slider range (defaults to 0-100)"},type:{type:String,default:"",description:"Slider type (e.g primary, danger etc)"},options:{type:Object,default:function(){return{}},description:"noUiSlider options"}},computed:{connect:function(){return Array.isArray(this.value)||[!0,!1]}},data:function(){return{slider:null}},methods:{createSlider:function(){var t=this;Qt.a.create(this.$refs.slider,Object(St["a"])({start:this.value,connect:this.connect,range:this.range},this.options));var e=this.$refs.slider.noUiSlider;e.on("slide",(function(){var a=e.get();a!==t.value&&t.$emit("input",a)}))}},mounted:function(){this.createSlider()},watch:{value:function(t,e){var a=this.$refs.slider.noUiSlider,s=a.get();t!==e&&s!==t&&(Array.isArray(s)&&Array.isArray(t)?e.length===t.length&&e.every((function(e,a){return e===t[a]}))&&a.set(t):a.set(t))}}},te=Xt,ee=Object(m["a"])(te,Gt,Kt,!1,null,null,null),ae=ee.exports,se=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("label",{staticClass:"custom-toggle"},[a("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.model)?t._i(t.model,null)>-1:t.model},on:{change:function(e){var a=t.model,s=e.target,i=!!s.checked;if(Array.isArray(a)){var l=null,o=t._i(a,l);s.checked?o<0&&(t.model=a.concat([l])):o>-1&&(t.model=a.slice(0,o).concat(a.slice(o+1)))}else t.model=i}}},"input",t.$attrs,!1),t.$listeners)),a("span",{staticClass:"custom-toggle-slider rounded-circle"})])},ie=[],le={name:"base-switch",inheritAttrs:!1,props:{value:{type:Boolean,default:!1,description:"Switch value"}},computed:{model:{get:function(){return this.value},set:function(t){this.$emit("input",t)}}}},oe=le,ne=Object(m["a"])(oe,se,ie,!1,null,null,null),re=ne.exports,ce=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"icon icon-shape",class:[t.size&&"icon-"+t.size,t.type&&"icon-shape-"+t.type,t.gradient&&"bg-gradient-"+t.gradient,t.shadow&&"shadow",t.rounded&&"rounded-circle",t.color&&"text-"+t.color]},[t._t("default",[a("i",{class:t.name})])],2)},de=[],ue={name:"icon",props:{name:{type:String,default:"",description:"Icon name"},size:{type:String,default:"",description:"Icon size"},type:{type:String,default:"",description:"Icon type (primary, warning etc)"},gradient:{type:String,default:"",description:"Icon gradient type (primary, warning etc)"},color:{type:String,default:"",description:"Icon color (primary, warning etc)"},shadow:{type:Boolean,default:!1,description:"Whether icon has shadow"},rounded:{type:Boolean,default:!1,description:"Whether icon is rounded"}}},pe=ue,me=Object(m["a"])(pe,ce,de,!1,null,null,null),ve=me.exports,fe={install:function(t){t.component(dt.name,dt),t.component(bt.name,bt),t.component(M.name,M),t.component(Tt.name,Tt),t.component(xt.name,xt),t.component(Nt.name,Nt),t.component(Lt.name,Lt),t.component(Yt.name,Yt),t.component(ae.name,ae),t.component(re.name,re),t.component(V.name,V),t.component(ve.name,ve)}},be={bind:function(t,e,a){t.clickOutsideEvent=function(s){t==s.target||t.contains(s.target)||a.context[e.expression](s)},document.body.addEventListener("click",t.clickOutsideEvent)},unbind:function(t){document.body.removeEventListener("click",t.clickOutsideEvent)}},ge={install:function(t){t.directive("click-outside",be)}},he=ge,_e=a("caf9"),ye={install:function(t){t.use(fe),t.use(he),t.use(_e["a"])}},Ce=a("5c96"),ke=a.n(Ce);a("0fae");l["default"].config.productionTip=!1,l["default"].use(ye),l["default"].use(ke.a);var xe=void 0,we=void 0,$e=!1,Se=it.data(),Oe=acquireVsCodeApi();function je(){$e||($e=!0,console.log("[builder options view] start init and create page ..."),new l["default"]({render:function(t){return t(it)}}).$mount("#app"),xe=it.methods.getInstance(),xe.$on("save-all",(function(){return Te()})),xe.$on("open-config",(function(){return Oe.postMessage("open-config")})),console.log("[builder options view] app inited done !"))}function Ae(t){it.methods.notify({type:t.success?"success":"error",title:t.success?"Success":"Failed",message:t.msg,position:"bottom-right"})}function Te(){if(xe){console.log("[builder options view] start post data ...");var t={before:"beforeBuildTasks",after:"afterBuildTasks"};for(var e in t){var a=xe.task[e];we[t[e]]=a}var s={global:"global",cpp:"c/cpp-compiler",asm:"asm-compiler",linker:"linker"};for(var l in s){var o,n=xe[l],r=we[s[l]],c=Object(i["a"])(n);try{for(c.s();!(o=c.n()).done;){var d=o.value;switch(d.type){case"array":d.value.length>0?r[d.name]=d.value.map((function(t){return t.value})):delete r[d.name];break;case"bool":d.value?r[d.name]=d.value:delete r[d.name];break;default:"string"==typeof d.value&&""==d.value.trim()?delete r[d.name]:r[d.name]=d.value;break}"string"==typeof r[d.name]&&(r[d.name]=r[d.name].replace(/\r\n|\n/g," ").replace(/\s{2,}/g," ").trim())}}catch(u){c.e(u)}finally{c.f()}}Oe.postMessage(we),console.log("[builder options view] post data done !")}else Ae({success:!1,msg:"App have not inited !"})}function Pe(t,e){var a,s=e.split("/"),l=t,o=Object(i["a"])(s);try{for(o.s();!(a=o.n()).done;){var n=a.value;if(""!=n){if(void 0==l)break;l=l[n]}}}catch(r){o.e(r)}finally{o.f()}return l}function Be(t,e){if(e["$ref"]){var a=Pe(t,e["$ref"].replace("#/",""));for(var s in a)void 0===e[s]&&(e[s]=a[s])}return e}function ze(t){return"huge"==t["size"]?"textarea":"small"==t["size"]?"short_input":Array.isArray(t.type)?"string":t.type}function Ie(t,e,a){var s=ze(t);switch(e.description=t.markdownDescription||t.description,De&&t["description.".concat(De)]&&(e.description=t["description.".concat(De)]),e.disable_readable_name=t.disable_readable_name,e.readable_name=t.readable_name,De&&t["readable_name.".concat(De)]&&(e.readable_name=t["readable_name.".concat(De)]),e.auto_complete_ctx=t["auto_complete_ctx"],s){case"array":e.type=s;break;case"boolean":e.type="bool";break;case"string":t["enum"]?(e.type="enum",e.enums=t["enum"],e.enumDesc=t["enumDescriptions"]||[]):(e.type="input",e.placeHolder=e.description);break;case"short_input":case"textarea":e.type=s,e.placeHolder=e.description;break;default:return console.warn("[builder options view] [warn] not support this type: '".concat(s,"' for field !")),!1}if("array"==s&&t.items)if(e.child_type=t.items.type,"string"==e.child_type)e.child_def_val=t.items.default||"",t.items["enum"]&&(e.enums=t.items["enum"],e.enumDesc=t.items["enumDescriptions"]||[]);else if("object"==e.child_type)for(var i in e.child_def_val={},e.child_key_meta={},t.items.properties)e.child_def_val[i]=t.items.properties[i].default,e.child_key_meta[i]=t.items.properties[i];if(a)switch(s){case"array":e.value=(Array.isArray(a)?a:[a]).map((function(t){return{value:t}}));break;case"boolean":e.value=a;break;default:e.value=Array.isArray(a)?a.join(" "):a;break}else"bool"==e.type?e.value=!1:"enum"==e.type?e.value=t.default||"":"array"==e.type?e.value=[]:e.value="";return!0}window.addEventListener("message",(function(t){if(t.data.status){var e={success:t.data.status.success,msg:t.data.status.msg};Ae(e)}else we=t.data.data,Ne(t.data.model,we,t.data.info),je()})),document.addEventListener("keydown",(function(t){"s"==t.key.toLowerCase()&&t.ctrlKey&&(t.preventDefault(),Te())})),Oe.postMessage("eide.options_view.launched");var De=void 0;function Ne(t,e,a){console.log("[builder options view] start init data ...");var s=t.properties,l={global:"global",cpp:"c/cpp-compiler",asm:"asm-compiler",linker:"linker"};for(var o in a&&(De=a.lang,Se.lang=De,Se.prjEnvList=a.envList,Se.contextData=a.contextData||{}),l){var n=s[l[o]].properties,r=e[l[o]],c=Se[o];for(var d in n){var u=Be(t,n[d]),p={name:d};Ie(u,p,r[d])&&c.push(p)}}var m={before:"beforeBuildTasks",after:"afterBuildTasks"};for(var v in m){var f=Se.task[v],b=e[m[v]];if(b&&Array.isArray(b)){var g,h=Object(i["a"])(b);try{for(h.s();!(g=h.n()).done;){var _=g.value;f.push(_)}}catch(y){h.e(y)}finally{h.f()}}}console.log("[builder options view] Init data done !")}},"85ec":function(t,e,a){},a4d4:function(t,e,a){},be87:function(t,e,a){},d5a0:function(t,e,a){}}); //# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/res/template/89c52_sdcc.ept b/res/template/89c52_sdcc.ept deleted file mode 100644 index 031df789..00000000 Binary files a/res/template/89c52_sdcc.ept and /dev/null differ diff --git a/res/template/mcs51.ept b/res/template/mcs51.ept deleted file mode 100644 index d877d331..00000000 Binary files a/res/template/mcs51.ept and /dev/null differ diff --git a/res/template/mcs51_sdcc.ept b/res/template/mcs51_sdcc.ept new file mode 100644 index 00000000..e68b7db5 Binary files /dev/null and b/res/template/mcs51_sdcc.ept differ diff --git a/res/template/stc15.ept b/res/template/stc15.ept deleted file mode 100644 index 48eff839..00000000 Binary files a/res/template/stc15.ept and /dev/null differ diff --git a/res/template/stc15_sdcc.ept b/res/template/stc15_sdcc.ept new file mode 100644 index 00000000..12d9640e Binary files /dev/null and b/res/template/stc15_sdcc.ept differ diff --git a/res/template/cosmic_stm8_empty.ept b/res/template/stm8_cosmic_empty.ept similarity index 100% rename from res/template/cosmic_stm8_empty.ept rename to res/template/stm8_cosmic_empty.ept diff --git a/res/template/stm8s103_sdcc.ept b/res/template/stm8s103_sdcc.ept deleted file mode 100644 index ae25d329..00000000 Binary files a/res/template/stm8s103_sdcc.ept and /dev/null differ diff --git a/res/template/stm8s103f3.ept b/res/template/stm8s103f3.ept deleted file mode 100644 index f05875cf..00000000 Binary files a/res/template/stm8s103f3.ept and /dev/null differ diff --git a/res/template/stm8s_cosmic.ept b/res/template/stm8s_cosmic.ept new file mode 100644 index 00000000..7b8440c0 Binary files /dev/null and b/res/template/stm8s_cosmic.ept differ diff --git a/res/template/stm8s_cosmic_quickstart.ept b/res/template/stm8s_cosmic_quickstart.ept deleted file mode 100644 index 14ecc71e..00000000 Binary files a/res/template/stm8s_cosmic_quickstart.ept and /dev/null differ diff --git a/res/template/stm8s_sdcc.ept b/res/template/stm8s_sdcc.ept new file mode 100644 index 00000000..f23fcebc Binary files /dev/null and b/res/template/stm8s_sdcc.ept differ diff --git a/src/CodeBuilder.ts b/src/CodeBuilder.ts index f30019cc..57d3ec56 100644 --- a/src/CodeBuilder.ts +++ b/src/CodeBuilder.ts @@ -50,7 +50,10 @@ import { ArrayDelRepetition } from "../lib/node-utility/Utility"; import { DependenceManager } from "./DependenceManager"; import { WorkspaceManager } from "./WorkspaceManager"; import { ToolchainName } from "./ToolchainManager"; -import { md5, sha256, copyObject, generateDotnetProgramCmd, generateRandomStr, isGccFamilyToolchain } from "./utility"; +import { + md5, sha256, copyObject, generateDotnetProgramCmd, generateRandomStr, + isGccFamilyToolchain, compareVersion +} from "./utility"; import { exeSuffix, osType } from "./Platform"; import { FileWatcher } from "../lib/node-utility/FileWatcher"; import { STVPFlasherOptions } from './HexUploader'; @@ -300,12 +303,20 @@ export abstract class CodeBuilder { if (SettingManager.GetInstance().isUseTaskToBuild() && WorkspaceManager.getInstance().hasWorkspaces()) { // use vscode task // setup shell - const shellOption: vscode.ShellExecutionOptions = {}; - if (os.platform() == 'win32') { shellOption.executable = 'cmd.exe'; shellOption.shellArgs = ['/C']; } - else { shellOption.executable = '/bin/bash'; shellOption.shellArgs = ['-c']; } - shellOption.env = process.env; + const shellOption: vscode.ShellExecutionOptions = { + env: process.env + }; + if (os.platform() == 'win32') { + shellOption.executable = 'cmd.exe'; + shellOption.shellArgs = ['/D', '/C']; + // FIXME: https://github.com/microsoft/vscode/issues/260534 + if (compareVersion(vscode.version, '1.103.0') < 0) + commandLine = `"${commandLine}"`; + } else { + shellOption.executable = '/bin/bash'; + shellOption.shellArgs = ['-c']; + } // setup task - if (os.platform() == 'win32') commandLine = `"${commandLine}"`; const task = new vscode.Task({ type: 'shell', command: commandLine }, vscode.TaskScope.Workspace, title, 'eide.builder', new vscode.ShellExecution(commandLine, shellOption), []); task.group = vscode.TaskGroup.Build; @@ -317,10 +328,12 @@ export abstract class CodeBuilder { } vscode.tasks.executeTask(task); } else { // use terminal - const index = vscode.window.terminals.findIndex((t) => { return t.name === title; }); - if (index !== -1) { vscode.window.terminals[index].dispose(); } + const index = vscode.window.terminals.findIndex(t => t.name === title); + if (index !== -1) + vscode.window.terminals[index].dispose(); const opts: vscode.TerminalOptions = { name: title, iconPath: new vscode.ThemeIcon('target') }; - if (os.platform() == 'win32') { opts.shellPath = 'cmd.exe'; }; + if (os.platform() == 'win32') + opts.shellPath = 'cmd.exe'; opts.env = process.env; const terminal = vscode.window.createTerminal(opts); if (!SettingManager.GetInstance().isSilentBuildOrFlash()) diff --git a/src/EIDEProjectExplorer.ts b/src/EIDEProjectExplorer.ts index 45f7579b..336a118b 100644 --- a/src/EIDEProjectExplorer.ts +++ b/src/EIDEProjectExplorer.ts @@ -1842,7 +1842,7 @@ class ProjectDataProvider implements vscode.TreeDataProvider, vsco dispType = 'show_all'; } - return new Promise((resolve) => { + return new Promise(async (resolve) => { const uid = new File(uri.fsPath).noSuffixName; const prj = this.getProjectByUid(uid); @@ -1958,7 +1958,26 @@ class ProjectDataProvider implements vscode.TreeDataProvider, vsco throw new Error(`Not found elf tool: '${elftool}' !`); } - let textLines = child_process.execFileSync(elftool, elfcmds).toString().split(/\r\n|\n/); + // Don't use 'child_process.execFileSync' because a huge file + // will cause an ENOBUF Error. + const doReadSymbolLines = (toolpath: string, cmds: string[]): Promise => { + return new Promise((resolve) => { + const executable = new ExeFile(); + const results: string[] = []; + executable.on('line', (line) => { + results.push(line); + }); + executable.on('close', () => { + resolve(results); + }); + executable.on('error', (err) => { + GlobalEvent.log_warn(err); + }); + executable.Run(toolpath, cmds); + }); + }; + + let textLines = await doReadSymbolLines(elftool, elfcmds); // filter lines // notes: @@ -2160,62 +2179,6 @@ class ProjectDataProvider implements vscode.TreeDataProvider, vsco resolve(outputLines.join(os.EOL)); - // - // @deprecated Because this lib is too slow - // - - // let maxLen = 0; - // for (const l of headerLines) { - // if (l.length > maxLen) maxLen = l.length; - // } - - // for (let i = 1; i < headerLines.length; i++) { - // headerLines[i] = headerLines[i].padEnd(maxLen); - // } - - // const tableCfg: TxtTable.TableUserConfig = { - - // header: { - // alignment: 'center', - // content: headerLines.join('\n') - // }, - - // drawHorizontalLine: (idx, rowCount) => idx <= 2 || idx === rowCount, - - // columns: { - // 0: { width: col_addr_maxLen }, - // 1: { width: col_size_maxLen }, - // 2: { width: col_type_maxLen }, - // 3: { width: col_name_maxLen }, - // 4: { width: col_loca_maxLen } - // }, - - // border: { - // topBody: `─`, - // topJoin: `┬`, - // topLeft: `┌`, - // topRight: `┐`, - - // bottomBody: `─`, - // bottomJoin: `┴`, - // bottomLeft: `└`, - // bottomRight: `┘`, - - // bodyLeft: `│`, - // bodyRight: `│`, - // bodyJoin: `│`, - - // joinBody: `─`, - // joinLeft: `├`, - // joinRight: `┤`, - // joinJoin: `┼` - // } - // }; - - // const result = TxtTable.table(resultLines, tableCfg); - - // resolve(result); - } catch (error) { resolve('Error: ' + (error).message); } @@ -4999,6 +4962,9 @@ export class ProjectExplorer implements CustomConfigurationProvider { `${AbstractProject.EIDE_DIR}${File.sep}*.dat`, ]; + if (SettingManager.instance().isEnableClangdConfigGenerator()) + defExcludeList.push('.clangd'); + // if this is a project, prehandle it let prj: AbstractProject | undefined; if (prjItem && isWorkspace == undefined) { diff --git a/src/OperationExplorer.ts b/src/OperationExplorer.ts index 618117ea..8917985f 100644 --- a/src/OperationExplorer.ts +++ b/src/OperationExplorer.ts @@ -392,15 +392,15 @@ export class OperationExplorer { type: 'C51' }, { - label: '8051 Empty Project (Keil C51 Compiler)', + label: '8051 Empty Project (SDCC)', detail: '8051 empty project', - templateName: 'mcs51', + templateName: 'mcs51_sdcc', type: 'C51' }, { label: 'STM8 Empty Project (COSMIC Compiler)', detail: 'stm8 empty project', - templateName: 'cosmic_stm8_empty', + templateName: 'stm8_cosmic_empty', type: 'C51' }, ]; @@ -414,56 +414,44 @@ export class OperationExplorer { { const itemList: ProjectTemplatePickItem[] = [ { - label: '8051 Quickstart', - detail: 'Universal 8051 quickstart project (Keil C51 Compiler)', - templateName: 'mcs51', + label: '8051 Quick Start (SDCC)', + detail: 'Universal 8051 example project with SDCC', + templateName: 'mcs51_sdcc', type: 'C51' }, { - label: '89C52 SDCC Quickstart', - detail: '89c52 quickstart project (SDCC)', - templateName: '89c52_sdcc', + label: 'STC15 Quick Start (SDCC)', + detail: 'stc15 example project with SDCC', + templateName: 'stc15_sdcc', type: 'C51' }, { - label: 'STC15 Keil_C51 Quickstart', - detail: 'stc15 quickstart project (Keil C51 Compiler)', - templateName: 'stc15', - type: 'C51' - }, - { - label: 'AVR FreeRTOS Quickstart', - detail: 'avr atmega128 quickstart project (FreeRTOS) (WinAVR-GCC)', + label: 'AVR FreeRTOS Quick Start (WinAVR-GCC)', + detail: 'avr atmega128 example project', templateName: 'avr_atmega128_rtos', type: 'ANY-GCC' }, { - label: 'STM8S COSMIC Quickstart', - detail: 'stm8s quickstart project (STM8S003,STM8S005,STM8S103) (COSMIC STM8 Compiler)', - templateName: 'stm8s_cosmic_quickstart', - type: 'C51' - }, - { - label: 'STM8 IAR Quickstart', - detail: 'stm8s103 quickstart project (IAR STM8 Compiler)', - templateName: 'stm8s103f3', + label: 'STM8S Quick Start (COSMIC STM8)', + detail: 'stm8s example project with COSMIC STM8 Compiler', + templateName: 'stm8s_cosmic', type: 'C51' }, { - label: 'STM8 SDCC Quickstart', - detail: 'stm8s103 quickstart project (SDCC)', - templateName: 'stm8s103_sdcc', + label: 'STM8S Quick Start (SDCC)', + detail: 'stm8s example project with SDCC', + templateName: 'stm8s_sdcc', type: 'C51' }, { - label: 'STM32F103 Cortex-M3 Quickstart', - detail: 'stm32f1xx gcc quickstart project (ARM GCC)', + label: 'STM32F103 Cortex-M3 Quick Start (GCC)', + detail: 'stm32f1xx gcc example project with gcc', templateName: 'stm32f1xx_gcc', type: 'ARM' }, { - label: 'GD32VF103 RISC-V Quickstart', - detail: 'gd32vf103 riscv quickstart project (RISC-V GCC)', + label: 'GD32VF103 RISC-V Quick Start', + detail: 'gd32vf103 riscv example project', templateName: 'gd32vf103_riscv', type: 'RISC-V' } @@ -1104,7 +1092,23 @@ export class OperationExplorer { description: group.desc || "" }; } - }).sort((a, b) => { return a.label.localeCompare(b.label); }); + }); + + if (curTempGroup.name === '/') { + category_sel_list = category_sel_list + .sort((a, b) => { + // 始终保证 'MCU' 分类处于第一个 + if (a.label === 'MCU') + return -1; + else if (b.label === 'MCU') + return 1; + else + return a.label.localeCompare(b.label); + }); + } else { + category_sel_list = category_sel_list + .sort((a, b) => a.label.localeCompare(b.label)); + } if (prevGroupStack.length > 0) { category_sel_list = [goBackItemForGroup].concat(category_sel_list); diff --git a/src/ResManager.ts b/src/ResManager.ts index 975c4f23..7e02fc2d 100644 --- a/src/ResManager.ts +++ b/src/ResManager.ts @@ -394,27 +394,31 @@ export class ResManager extends events.EventEmitter { /* ------- get internal headers ------ */ getArmccForceIncludeHeaders(): File { - return File.fromArray([(this.GetDir('include')).path, 'internal_headers', 'armcc_intr.h']); + return File.from(this.GetAppDataDir().path, 'builtin_headers', 'lint_armcc.h'); } getArmclangForceIncludeHeaders(): File { - return File.fromArray([(this.GetDir('include')).path, 'internal_headers', 'armclang_intr.h']); + return File.from(this.GetAppDataDir().path, 'builtin_headers', 'lint_armclang.h'); } getGccForceIncludeHeaders(): File { - return File.fromArray([(this.GetDir('include')).path, 'internal_headers', 'gcc_intr.h']); + return File.from(this.GetAppDataDir().path, 'builtin_headers', 'lint_armgcc.h'); } - getC51ForceIncludeHeaders(): File { - return File.fromArray([(this.GetDir('include')).path, 'internal_headers', 'c51_intr.h']); + getKeilC51ForceIncludeHeaders(): File { + return File.from(this.GetAppDataDir().path, 'builtin_headers', 'lint_keilc51.h'); + } + + getSdccForceIncludeHeaders(): File { + return File.from(this.GetAppDataDir().path, 'builtin_headers', 'lint_sdcc.h'); } getIarStm8ForceIncludeHeaders(): File { - return File.fromArray([(this.GetDir('include')).path, 'internal_headers', 'iar_stm8_intr.h']); + return File.from(this.GetAppDataDir().path, 'builtin_headers', 'lint_iarstm8.h'); } getIarArmForceIncludeHeaders(): File { - return File.fromArray([(this.GetDir('include')).path, 'internal_headers', 'iar_arm_intr.h']); + return File.from(this.GetAppDataDir().path, 'builtin_headers', 'lint_iararm.h'); } /* ------------------ builder and runtime ----------------- */ diff --git a/src/ToolchainManager.ts b/src/ToolchainManager.ts index 80b9e941..9ceccd9b 100644 --- a/src/ToolchainManager.ts +++ b/src/ToolchainManager.ts @@ -490,7 +490,7 @@ class KeilC51 implements IToolchian { getForceIncludeHeaders(): string[] | undefined { return [ - ResManager.GetInstance().getC51ForceIncludeHeaders().path + ResManager.GetInstance().getKeilC51ForceIncludeHeaders().path ]; } @@ -1123,7 +1123,7 @@ class SDCC implements IToolchian { getForceIncludeHeaders(): string[] | undefined { return [ - ResManager.GetInstance().getC51ForceIncludeHeaders().path + ResManager.GetInstance().getSdccForceIncludeHeaders().path ]; } diff --git a/src/utility.ts b/src/utility.ts index 487c2bbb..dc03b638 100644 --- a/src/utility.ts +++ b/src/utility.ts @@ -570,14 +570,15 @@ export async function runShellCommand(title: string, commandLine: string, opts?: }; if (platform.osType() == 'win32') { shellOption.executable = 'cmd.exe'; - shellOption.shellArgs = ['/C']; + shellOption.shellArgs = ['/D', '/C']; + // FIXME: https://github.com/microsoft/vscode/issues/260534 + if (compareVersion(vscode.version, '1.103.0') < 0) + commandLine = `"${commandLine}"`; } else { shellOption.executable = '/bin/bash'; shellOption.shellArgs = ['-c']; } // init task - if (platform.osType() == 'win32') - commandLine = `"${commandLine}"`; const task = new vscode.Task({ type: 'shell', command: commandLine }, vscode.TaskScope.Global, title, opts?.source || 'eide', new vscode.ShellExecution(commandLine, shellOption), []); task.isBackground = false;