diff --git a/CHANGELOG.md b/CHANGELOG.md index 3324883d..a5964a0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,30 @@ All notable version changes will be recorded in this file. *** -### [v3.23.9] revision +### [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**: + - `Create Project`: Miscellaneous things. (init project files, init project settings ... etc.) + +*** + +### [v3.23.12] revision **Improve**: - `GNU Arm Toolchain`: Support new mcpu: `cortex-m52, cortex-m55, cortex-m85`. @@ -15,6 +38,9 @@ All notable version changes will be recorded in this file. - `File Options`: Add memory assignment feature for `AC5`, `AC6` toolchain. Thanks the contributor [Deadline039](https://github.com/Deadline039) - `File Options GUI`: Update the translation text. Optimize layout. - `DebugConfig Generator GUI`: Change gui element width. Sort the option result list. + - `AC5/AC6 Assembler`: Support use `=` preprocessor format for AC5/AC6 armasm. + - `Makefile Generator`: Improve makefile generator. + - `Builder Options`: Add more options for `arm-gcc` and `any-gcc` toolchain. **Fix**: - `IAR ARM Toolchain`: Miss auto-gen `-I` params for iar assembler. @@ -23,6 +49,7 @@ All notable version changes will be recorded in this file. **Change**: - `EIDE View Container`: By default, we will collapse the `Operations` view. + - `Webpanel Views`: Starting from this version, we will use singleton pattern for `Builder Options View`, `Storage Layout View`, `Cmsis Header Config Wizard`, This means that for each view, only one page can be opened for each project. *** diff --git a/lang/any.gcc.verify.json b/lang/any.gcc.verify.json index e436e935..5ec88a8d 100644 --- a/lang/any.gcc.verify.json +++ b/lang/any.gcc.verify.json @@ -122,9 +122,21 @@ "description.zh-cn": "全局选项", "type": "object", "properties": { + "output-debug-info": { + "markdownDescription": "Output debug information", + "description.zh-cn": "输出调试信息", + "type": "string", + "default": "disable", + "enum": [ + "disable", + "enable", + "dwarf-2", + "dwarf-3" + ] + }, "misc-control": { - "markdownDescription": "Global Params", - "description.zh-cn": "编译器全局参数", + "markdownDescription": "Global Options", + "description.zh-cn": "编译器全局选项", "$ref": "#/definitions/FLAGS", "default": "" } @@ -135,6 +147,46 @@ "description.zh-cn": "C/C++ 编译器选项", "type": "object", "properties": { + "language-c": { + "markdownDescription": "C Standard", + "description.zh-cn": "C 标准", + "type": "string", + "default": "", + "enum": [ + "c89", + "c90", + "c99", + "c11", + "c17", + "c23", + "gnu89", + "gnu90", + "gnu99", + "gnu11", + "gnu17", + "gnu23" + ] + }, + "language-cpp": { + "markdownDescription": "C++ Standard", + "description.zh-cn": "C++ 标准", + "type": "string", + "default": "", + "enum": [ + "c++98", + "gnu++98", + "c++11", + "gnu++11", + "c++14", + "gnu++14", + "c++17", + "gnu++17", + "c++20", + "gnu++20", + "c++23", + "gnu++23" + ] + }, "optimization": { "markdownDescription": "Optimization Level", "description.zh-cn": "代码优化级别", @@ -174,6 +226,11 @@ "markdownDescription": "Data Sections (-fdata-sections)", "type": "boolean" }, + "signed-char": { + "markdownDescription": "Signed Char (-fsigned-char)", + "description.zh-cn": "Signed Char (-fsigned-char)", + "type": "boolean" + }, "no-rtti": { "markdownDescription": "Not use RTTI (-fno-rtti)", "description.zh-cn": "禁用运行时类型信息 (-fno-rtti)", @@ -184,17 +241,33 @@ "description.zh-cn": "禁用异常处理 (-fno-exceptions)", "type": "boolean" }, + "warnings": { + "markdownDescription": "Warning Level", + "description.zh-cn": "警告等级", + "type": "string", + "default": "unspecified", + "enum": [ + "unspecified", + "no-warnings", + "all-warnings" + ] + }, + "turn-Warning-into-errors": { + "markdownDescription": "Turn warnings into errors", + "description.zh-cn": "将警告转化为错误", + "type": "boolean" + }, "C_FLAGS": { - "markdownDescription": "C Compiler Params", - "description.zh-cn": "C 编译器参数", + "markdownDescription": "C Compiler Options", + "description.zh-cn": "C 编译器选项", "$ref": "#/definitions/FLAGS", - "default": "-c -x c" + "default": "" }, "CXX_FLAGS": { - "markdownDescription": "C++ Compiler Params", - "description.zh-cn": "C++ 编译器参数", + "markdownDescription": "C++ Compiler Options", + "description.zh-cn": "C++ 编译器选项", "$ref": "#/definitions/FLAGS", - "default": "-c -x c++" + "default": "" } } }, @@ -215,7 +288,7 @@ }, "ASM_FLAGS": { "markdownDescription": "Assembler Options", - "description.zh-cn": "汇编器参数", + "description.zh-cn": "汇编器选项", "$ref": "#/definitions/FLAGS", "default": "-c -x assembler" } @@ -251,10 +324,41 @@ "LIB" ] }, + "$disableOutputTask": { + "type": "boolean", + "markdownDescription": "Don't Output Hex/Bin/S19 Files", + "description.zh-cn": "不生成 Hex/Bin/S19 等二进制文件", + "enum": [ + true, + false + ] + }, + "$outputTaskExcludes": { + "type": "array", + "markdownDescription": "Don't Output Specific Binary Files", + "description.zh-cn": "不生成指定的二进制文件", + "default": [], + "items": { + "type": "string", + "default": ".bin", + "enum": [ + ".bin", + ".hex" + ], + "enumDescriptions": [ + "*.bin file", + "*.hex file" + ] + } + }, "remove-unused-input-sections": { "markdownDescription": "Remove Unused Input Sections (-Wl,--gc-sections)", "type": "boolean" }, + "print-mem-usage": { + "markdownDescription": "Print Memory Usage For Each Section (-Wl,--print-memory-usage)", + "type": "boolean" + }, "elf-suffix": { "type": "string", "size": "small", @@ -265,15 +369,15 @@ "default": ".elf" }, "LD_FLAGS": { - "readable_name": "Linker Flags", - "readable_name.zh-cn": "链接器参数", + "readable_name": "Linker Options", + "readable_name.zh-cn": "链接器选项", "markdownDescription": "Use '-Wl[,option]...' pass options to the linker", "description.zh-cn": "使用 '-Wl[,option]...' 传递链接器选项", "$ref": "#/definitions/FLAGS", "default": "" }, "LIB_FLAGS": { - "readable_name": "Lib Flags", + "readable_name": "Lib Options", "readable_name.zh-cn": "链接库", "markdownDescription": "Lib Flags, like: -lxxx", "description.zh-cn": "链接库,例如:-lxxx", diff --git a/lang/arm.gcc.verify.json b/lang/arm.gcc.verify.json index c3415101..042b3c1f 100644 --- a/lang/arm.gcc.verify.json +++ b/lang/arm.gcc.verify.json @@ -380,6 +380,14 @@ "markdownDescription": "Not Print Memory Usage (disable: -Wl,--print-memory-usage)", "type": "boolean" }, + "use-float-printf": { + "markdownDescription": "Enable float-point for printf(...) function (-u _printf_float)", + "type": "boolean" + }, + "use-float-scanf": { + "markdownDescription": "Enable float-point for scanf(...) function (-u _scanf_float)", + "type": "boolean" + }, "LD_FLAGS": { "readable_name": "Other Linker Options", "readable_name.zh-cn": "链接器附加选项", diff --git a/lang/arm.v6.verify.json b/lang/arm.v6.verify.json index e761bfeb..00a823f9 100644 --- a/lang/arm.v6.verify.json +++ b/lang/arm.v6.verify.json @@ -309,7 +309,7 @@ ], "enumDescriptions": [ "arm-asm (arm syntax)", - "arm-auto (auto select)", + "arm-auto (auto detect)", "arm-clang (gnu syntax)" ] }, diff --git a/package.json b/package.json index c1460cad..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.9", + "version": "3.23.14", "preview": false, "engines": { "vscode": "^1.67.0" @@ -262,7 +262,7 @@ "type": "string", "scope": "resource", "markdownDescription": "%settings.cppcheck.exec.path%", - "default": "${userRoot}/.eide/tools/cppcheck/cppcheck.exe" + "default": "${userHome}/.eide/tools/cppcheck/cppcheck.exe" }, "EIDE.Builder.ThreadNumber": { "type": "integer", @@ -377,17 +377,11 @@ "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": "${userRoot}/.eide/tools/stm8_gnu_sdcc" - }, "EIDE.STM8.COSMIC.InstallDirectory": { "type": "string", "scope": "resource", "markdownDescription": "COSMIC CXSTM8 root folder path", - "default": "${userRoot}/.eide/tools/cosmic_stm8" + "default": "${userHome}/.eide/tools/cosmic_stm8" }, "EIDE.ARM.ARMCC5.InstallDirectory": { "type": "string", @@ -411,13 +405,13 @@ "type": "string", "scope": "resource", "markdownDescription": "%settings.arm.gcc.install.folder%", - "default": "${userRoot}/.eide/tools/gcc_arm" + "default": "${userHome}/.eide/tools/gcc_arm" }, "EIDE.ARM.LLVM.InstallDirectory": { "type": "string", "scope": "resource", "markdownDescription": "%settings.arm.llvm.install.folder%", - "default": "${userRoot}/.eide/tools/llvm_arm" + "default": "${userHome}/.eide/tools/llvm_arm" }, "EIDE.ARM.INI.Path": { "type": "string", @@ -429,19 +423,19 @@ "type": "string", "scope": "resource", "markdownDescription": "%settings.jlink.install.folder%", - "default": "${userRoot}/.eide/tools/jlink" + "default": "${userHome}/.eide/tools/jlink" }, "EIDE.OpenOCD.ExePath": { "type": "string", "scope": "resource", "markdownDescription": "%settings.openocd.install.folder%", - "default": "${userRoot}/.eide/tools/openocd/bin/openocd.exe" + "default": "${userHome}/.eide/tools/openocd/bin/openocd.exe" }, "EIDE.STLink.ExePath": { "type": "string", "scope": "resource", "markdownDescription": "%settings.stlink.install.folder%", - "default": "${userRoot}/.eide/tools/st_cube_programer/bin/STM32_Programmer_CLI.exe" + "default": "${userHome}/.eide/tools/st_cube_programer/bin/STM32_Programmer_CLI.exe" }, "EIDE.ARM.Option.AutoGenerateRTE_Components": { "type": "boolean", @@ -459,7 +453,7 @@ "type": "string", "scope": "resource", "markdownDescription": "%settings.stvp.path%", - "default": "${userRoot}/.eide/tools/stvp/STVP_CmdLine.exe" + "default": "${userHome}/.eide/tools/stvp/STVP_CmdLine.exe" }, "EIDE.C51.INI.Path": { "type": "string", @@ -471,13 +465,13 @@ "type": "string", "scope": "resource", "markdownDescription": "%settings.sdcc.install.folder%", - "default": "${userRoot}/.eide/tools/sdcc" + "default": "${userHome}/.eide/tools/sdcc" }, "EIDE.RISCV.InstallDirectory": { "type": "string", "scope": "resource", "markdownDescription": "%settings.riscv.gcc.install.folder%", - "default": "${userRoot}/.eide/tools/gcc_riscv" + "default": "${userHome}/.eide/tools/gcc_riscv" }, "EIDE.RISCV.ToolPrefix": { "type": "string", @@ -943,8 +937,8 @@ } }, { - "command": "_cl.eide.project.configToolchain", - "title": "%eide.builder.config%" + "command": "_cl.eide.project.setupToolchain", + "title": "%eide.builder.setup-toochain%" }, { "command": "_cl.eide.project.switchUploader", @@ -1540,7 +1534,7 @@ "when": "viewItem == COMPILE_CONFIGURATION && view == cl.eide.view.projects" }, { - "command": "_cl.eide.project.configToolchain", + "command": "_cl.eide.project.setupToolchain", "when": "viewItem == COMPILE_CONFIGURATION && view == cl.eide.view.projects" }, { diff --git a/package.nls.json b/package.nls.json index 132bb6b9..02a8b5cc 100644 --- a/package.nls.json +++ b/package.nls.json @@ -70,8 +70,8 @@ "eide.explorer.modify.file.path": "Modify File Path", "eide.explorer.modify.exclude_list": "Modify Source File Exclude List", "eide.explorer.file.compile": "Compile", - "eide.explorer.file.modify.extraArgs": "Modify Compiler Options", - "eide.explorer.folder.modify.extraArgs": "Modify Compiler Options", + "eide.explorer.file.modify.extraArgs": "Show/Modify Compiler Options", + "eide.explorer.folder.modify.extraArgs": "Show/Modify Compiler Options", "eide.source.show_cmsis_config_wizard": "CMSIS Configuration Wizard", "eide.source.show.disassembly": "Show Disassembly", @@ -84,8 +84,8 @@ "eide.package.comp.uninstall": "Uninstall Component", "eide.builder.switch": "Select Toolchain", - "eide.builder.config": "Configure Toolchain", - "eide.builder.setup-toolchain-prefix": "Setup Compiler Prefix", + "eide.builder.setup-toochain": "Setup Toolchain", + "eide.builder.setup-toolchain-prefix": "Setup Toolchain Prefix", "eide.flash.switch": "Select Flasher", "eide.flash.gen.dbgconf": "Generate Debugger Configuration", @@ -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/package.nls.zh-CN.json b/package.nls.zh-CN.json index 55abaee6..8c68b003 100644 --- a/package.nls.zh-CN.json +++ b/package.nls.zh-CN.json @@ -70,8 +70,8 @@ "eide.explorer.modify.file.path": "修改源文件路径", "eide.explorer.modify.exclude_list": "修改源文件排除列表", "eide.explorer.file.compile": "编译", - "eide.explorer.file.modify.extraArgs": "修改此文件的编译器选项", - "eide.explorer.folder.modify.extraArgs": "修改此文件夹的编译器选项", + "eide.explorer.file.modify.extraArgs": "查看/修改此文件的编译选项", + "eide.explorer.folder.modify.extraArgs": "查看/修改此文件夹的编译选项", "eide.source.show_cmsis_config_wizard": "CMSIS Configuration Wizard", "eide.source.show.disassembly": "查看反汇编", @@ -84,7 +84,7 @@ "eide.package.comp.uninstall": "移除组件", "eide.builder.switch": "切换编译器", - "eide.builder.config": "编译器配置", + "eide.builder.setup-toochain": "设置编译器", "eide.builder.setup-toolchain-prefix": "设置编译器前缀", "eide.flash.switch": "切换烧录器", diff --git a/res/data/.clang-format b/res/data/.clang-format index ecc57c4a..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: Cpp - -################################### -# 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/data/models/any.gcc.model.json b/res/data/models/any.gcc.model.json index 6e6c3ccc..ae70e9d3 100644 --- a/res/data/models/any.gcc.model.json +++ b/res/data/models/any.gcc.model.json @@ -8,6 +8,21 @@ "matcher": "\\((?.*?)\\) (?[\\d\\.]+)" }, "global": { + "output-debug-info": { + "type": "selectable", + "command": { + "enable": "-g", + "disable": "", + "dwarf-2": "-g -gdwarf-2", + "dwarf-3": "-g -gdwarf-3", + "false": "" + }, + "group": [ + "c", + "cpp", + "asm" + ] + }, "optimization": { "type": "selectable", "command": { @@ -39,6 +54,17 @@ "linker-g++" ] }, + "signed-char": { + "type": "selectable", + "command": { + "true": "-fsigned-char", + "false": "-funsigned-char" + }, + "group": [ + "c", + "cpp" + ] + }, "no-rtti": { "type": "selectable", "command": { @@ -82,6 +108,30 @@ "cpp" ] }, + "turn-Warning-into-errors": { + "type": "selectable", + "command": { + "true": "-Werror", + "false": "" + }, + "group": [ + "c", + "cpp" + ] + }, + "warnings": { + "type": "selectable", + "command": { + "false": "", + "unspecified": "", + "no-warnings": "-w", + "all-warnings": "-Wall" + }, + "group": [ + "c", + "cpp" + ] + }, "misc-control": { "type": "list", "command": "", @@ -127,7 +177,15 @@ "useFile": true, "body": "@${value}" }, - "$output": "-o ${out} -MMD ${in}" + "$output": "-o ${out} -MMD ${in}", + "$default": [ + "-c", + "-xc" + ], + "$language-c": { + "type": "value", + "command": "-std=" + } }, "cpp": { "$path": "bin/${toolPrefix}g++", @@ -142,7 +200,14 @@ "useFile": true, "body": "@${value}" }, - "$output": "-o ${out} -MMD ${in}" + "$output": "-o ${out} -MMD ${in}", + "$default": [ + "-c" + ], + "$language-cpp": { + "type": "value", + "command": "-std=" + } }, "asm": { "$path": "bin/${toolPrefix}gcc", @@ -154,6 +219,10 @@ "useFile": true, "body": "@${value}" }, + "$default": [ + "-c", + "-x assembler-with-cpp" + ], "defines": { "type": "list", "command": "-D" @@ -178,6 +247,13 @@ "type": "list", "command": "" }, + "print-mem-usage": { + "type": "selectable", + "command": { + "true": "-Wl,--print-memory-usage", + "false": "" + } + }, "remove-unused-input-sections": { "type": "selectable", "command": { @@ -196,7 +272,21 @@ "LD_FLAGS": { "type": "list", "command": "" - } + }, + "$outputBin": [ + { + "name": "output hex file", + "toolPath": "bin/${toolPrefix}objcopy", + "outputSuffix": ".hex", + "command": "-O ihex ${linkerOutput} ${output}" + }, + { + "name": "output bin file", + "toolPath": "bin/${toolPrefix}objcopy", + "outputSuffix": ".bin", + "command": "-O binary ${linkerOutput} ${output}" + } + ] }, "linker-g++": { "$path": "bin/${toolPrefix}g++", @@ -217,6 +307,13 @@ "type": "list", "command": "" }, + "print-mem-usage": { + "type": "selectable", + "command": { + "true": "-Wl,--print-memory-usage", + "false": "" + } + }, "remove-unused-input-sections": { "type": "selectable", "command": { @@ -235,7 +332,21 @@ "LD_FLAGS": { "type": "list", "command": "" - } + }, + "$outputBin": [ + { + "name": "output hex file", + "toolPath": "bin/${toolPrefix}objcopy", + "outputSuffix": ".hex", + "command": "-O ihex ${linkerOutput} ${output}" + }, + { + "name": "output bin file", + "toolPath": "bin/${toolPrefix}objcopy", + "outputSuffix": ".bin", + "command": "-O binary ${linkerOutput} ${output}" + } + ] }, "linker-ld": { "$path": "bin/${toolPrefix}ld", @@ -256,6 +367,13 @@ "type": "list", "command": "" }, + "print-mem-usage": { + "type": "selectable", + "command": { + "true": "--print-memory-usage", + "false": "" + } + }, "remove-unused-input-sections": { "type": "selectable", "command": { @@ -274,7 +392,21 @@ "LD_FLAGS": { "type": "list", "command": "" - } + }, + "$outputBin": [ + { + "name": "output hex file", + "toolPath": "bin/${toolPrefix}objcopy", + "outputSuffix": ".hex", + "command": "-O ihex ${linkerOutput} ${output}" + }, + { + "name": "output bin file", + "toolPath": "bin/${toolPrefix}objcopy", + "outputSuffix": ".bin", + "command": "-O binary ${linkerOutput} ${output}" + } + ] }, "linker-lib": { "$path": "bin/${toolPrefix}ar", diff --git a/res/data/models/arm.gcc.model.json b/res/data/models/arm.gcc.model.json index 7dee94c6..255872f6 100644 --- a/res/data/models/arm.gcc.model.json +++ b/res/data/models/arm.gcc.model.json @@ -505,6 +505,20 @@ "false": "-Wl,--print-memory-usage" } }, + "use-float-printf": { + "type": "selectable", + "command": { + "true": "-u _printf_float", + "false": "" + } + }, + "use-float-scanf": { + "type": "selectable", + "command": { + "true": "-u _scanf_float", + "false": "" + } + }, "$outputBin": [ { "name": "output hex file", diff --git a/res/data/models/arm.v5.model.json b/res/data/models/arm.v5.model.json index 76f70809..d32038c4 100644 --- a/res/data/models/arm.v5.model.json +++ b/res/data/models/arm.v5.model.json @@ -346,7 +346,11 @@ ], "defines": { "type": "list", - "command": "--pd " + "command": "--pd ", + "mapper": { + "^\\s*([\\w\\$]+)=(.+)": "\"$1 SETA $2\"", + "^\\s*([\\w\\$]+)\\s*$": "\"$1 SETA 1\"" + } }, "use-microLIB": { "type": "selectable", diff --git a/res/data/models/arm.v6.model.json b/res/data/models/arm.v6.model.json index f7b53042..4a3693fe 100644 --- a/res/data/models/arm.v6.model.json +++ b/res/data/models/arm.v6.model.json @@ -499,9 +499,16 @@ "useFile": true, "body": "--Via ${value}" }, + "$default": [ + "--diag_suppress=A1950" + ], "defines": { "type": "list", - "command": "--pd " + "command": "--pd ", + "mapper": { + "^\\s*([\\w\\$]+)=(.+)": "\"$1 SETA $2\"", + "^\\s*([\\w\\$]+)\\s*$": "\"$1 SETA 1\"" + } }, "use-microLIB": { "type": "selectable", @@ -527,6 +534,10 @@ "-c", "-x assembler-with-cpp" ], + "masm": { + "type": "value", + "command": "-masm=" + }, "defines": { "type": "list", "command": "-D" 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/res/tools/darwin/unify_builder/arm64/unify_builder.deps.json b/res/tools/darwin/unify_builder/arm64/unify_builder.deps.json index b251f143..5965e3f9 100644 --- a/res/tools/darwin/unify_builder/arm64/unify_builder.deps.json +++ b/res/tools/darwin/unify_builder/arm64/unify_builder.deps.json @@ -7,7 +7,7 @@ "targets": { ".NETCoreApp,Version=v6.0": {}, ".NETCoreApp,Version=v6.0/osx-arm64": { - "unify_builder/3.10.3": { + "unify_builder/3.10.4": { "dependencies": { "CommandLineParser": "2.9.1", "ConsoleTableExt": "3.1.9", @@ -122,7 +122,7 @@ } }, "libraries": { - "unify_builder/3.10.3": { + "unify_builder/3.10.4": { "type": "project", "serviceable": false, "sha512": "" diff --git a/res/tools/darwin/unify_builder/arm64/unify_builder.dll b/res/tools/darwin/unify_builder/arm64/unify_builder.dll index 429f02cc..1f9a9656 100644 Binary files a/res/tools/darwin/unify_builder/arm64/unify_builder.dll and b/res/tools/darwin/unify_builder/arm64/unify_builder.dll differ diff --git a/res/tools/darwin/unify_builder/x86_64/unify_builder.deps.json b/res/tools/darwin/unify_builder/x86_64/unify_builder.deps.json index 9fd08148..4a8d6873 100644 --- a/res/tools/darwin/unify_builder/x86_64/unify_builder.deps.json +++ b/res/tools/darwin/unify_builder/x86_64/unify_builder.deps.json @@ -7,7 +7,7 @@ "targets": { ".NETCoreApp,Version=v6.0": {}, ".NETCoreApp,Version=v6.0/osx-x64": { - "unify_builder/3.10.3": { + "unify_builder/3.10.4": { "dependencies": { "CommandLineParser": "2.9.1", "ConsoleTableExt": "3.1.9", @@ -122,7 +122,7 @@ } }, "libraries": { - "unify_builder/3.10.3": { + "unify_builder/3.10.4": { "type": "project", "serviceable": false, "sha512": "" diff --git a/res/tools/darwin/unify_builder/x86_64/unify_builder.dll b/res/tools/darwin/unify_builder/x86_64/unify_builder.dll index b2904f82..f8db8dbf 100644 Binary files a/res/tools/darwin/unify_builder/x86_64/unify_builder.dll and b/res/tools/darwin/unify_builder/x86_64/unify_builder.dll differ diff --git a/res/tools/linux/unify_builder/unify_builder.deps.json b/res/tools/linux/unify_builder/unify_builder.deps.json index 152b432c..723e4183 100644 --- a/res/tools/linux/unify_builder/unify_builder.deps.json +++ b/res/tools/linux/unify_builder/unify_builder.deps.json @@ -7,7 +7,7 @@ "targets": { ".NETCoreApp,Version=v6.0": {}, ".NETCoreApp,Version=v6.0/linux-x64": { - "unify_builder/3.10.3": { + "unify_builder/3.10.4": { "dependencies": { "CommandLineParser": "2.9.1", "ConsoleTableExt": "3.1.9", @@ -122,7 +122,7 @@ } }, "libraries": { - "unify_builder/3.10.3": { + "unify_builder/3.10.4": { "type": "project", "serviceable": false, "sha512": "" diff --git a/res/tools/linux/unify_builder/unify_builder.dll b/res/tools/linux/unify_builder/unify_builder.dll index b2904f82..f8db8dbf 100644 Binary files a/res/tools/linux/unify_builder/unify_builder.dll and b/res/tools/linux/unify_builder/unify_builder.dll differ diff --git a/res/tools/win32/unify_builder/unify_builder.deps.json b/res/tools/win32/unify_builder/unify_builder.deps.json index 4c698eb7..8af6ef52 100644 --- a/res/tools/win32/unify_builder/unify_builder.deps.json +++ b/res/tools/win32/unify_builder/unify_builder.deps.json @@ -7,7 +7,7 @@ "targets": { ".NETCoreApp,Version=v6.0": {}, ".NETCoreApp,Version=v6.0/win-x64": { - "unify_builder/3.10.3": { + "unify_builder/3.10.4": { "dependencies": { "CommandLineParser": "2.9.1", "ConsoleTableExt": "3.1.9", @@ -122,7 +122,7 @@ } }, "libraries": { - "unify_builder/3.10.3": { + "unify_builder/3.10.4": { "type": "project", "serviceable": false, "sha512": "" diff --git a/res/tools/win32/unify_builder/unify_builder.dll b/res/tools/win32/unify_builder/unify_builder.dll index cbc56d5d..1bd0e27a 100644 Binary files a/res/tools/win32/unify_builder/unify_builder.dll and b/res/tools/win32/unify_builder/unify_builder.dll differ diff --git a/res/tools/win32/unify_builder/unify_builder.exe b/res/tools/win32/unify_builder/unify_builder.exe index 694c7ec8..0243e853 100644 Binary files a/res/tools/win32/unify_builder/unify_builder.exe and b/res/tools/win32/unify_builder/unify_builder.exe differ diff --git a/src/CodeBuilder.ts b/src/CodeBuilder.ts index 3fdb04e4..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()) @@ -1107,14 +1120,10 @@ export class ARMCodeBuilder extends CodeBuilder { if (['AC5', 'AC6'].includes(config.toolchain) && settingManager.IsConvertAxf2Elf() && options['linker']['$disableOutputTask'] != true) { - - const tool_root_folder = this.project.getToolchainLocation().path; - const ouput_path = `\${outDir}${File.sep}${config.name}`; - const axf2elf_log = `\${outDir}${File.sep}axf2elf.log`; - + const axf2elf_log = `\${OutDir}/axf2elf.log`; extraCommands.push({ name: 'axf to elf', - command: `axf2elf -d "${tool_root_folder}" -i "${ouput_path}.axf" -o "${ouput_path}.elf" > "${axf2elf_log}"` + command: `axf2elf -d "\${ToolchainRoot}" -i "\${OutDir}/\${ProjectName}.axf" -o "\${OutDir}/\${ProjectName}.elf" > "${axf2elf_log}"` }); } diff --git a/src/EIDEProject.ts b/src/EIDEProject.ts index c68ad679..5bcfdaff 100644 --- a/src/EIDEProject.ts +++ b/src/EIDEProject.ts @@ -62,7 +62,8 @@ import { ResInstaller } from './ResInstaller'; import { view_str$prompt$filesOptionsComment, view_str$prompt$reloadForOldProject, - view_str$prompt$not_found_compiler, view_str$operation$name_can_not_be_blank, + view_str$prompt$not_found_compiler, view_str$prompt$not_found_gcc_prompt_user_setup, + view_str$operation$name_can_not_be_blank, view_str$operation$name_can_not_have_invalid_char, view_str$prompt$project_is_opened_by_another, WARNING, @@ -2140,20 +2141,18 @@ $(OUT_DIR): private getEnvFileDefCont(): string[] { return [ `###########################################################`, - `# project environment variables`, + `# Project Environment Variables`, `###########################################################`, ``, + `## Global Variables`, + ``, `# append command prefix for toolchain`, `#COMPILER_CMD_PREFIX=`, - ``, `# mcu ram size (used to print memory usage)`, `#MCU_RAM_SIZE=0x00`, - ``, `# mcu rom size (used to print memory usage)`, `#MCU_ROM_SIZE=0x00`, ``, - `# put your global variables ...`, - `#GLOBAL_VAR=`, ``, ].map((line) => line); } @@ -2538,7 +2537,7 @@ $(OUT_DIR): this.registerBuiltinVar('ToolchainRoot', () => toolchainRoot); const curOptions = prjConfig.compileConfigModel.getOptions(); - const newOptions = toolManager.upgradeBuilderOptions(curOptions, this.toolchain); + const newOptions = toolManager.migrateBuilderOptions(curOptions, this.toolchain); if (newOptions) { prjConfig.compileConfigModel.setOptions(newOptions, undefined, this.toolchain.name); } @@ -2638,6 +2637,7 @@ $(OUT_DIR): this.registerBuiltinVar(key, () => process.env[key] || ''); } } + this.registerBuiltinVar('EIDE_PY3_CMD', () => ResManager.instance().getPython3()); } private RegisterEvent(): void { @@ -2922,7 +2922,11 @@ $(OUT_DIR): } public checkAndNotifyInstallToolchain(): boolean { + const toolchain = this.getToolchain(); + const toolchainManager = ToolchainManager.getInstance(); + + // support xpack package.json if (isGccFamilyToolchain(toolchain.name) && toolchain.getToolchainPrefix) { try { if (vscode.workspace.workspaceFile) { @@ -2950,13 +2954,22 @@ $(OUT_DIR): return false } } - const toolchainManager = ToolchainManager.getInstance(); + if (!toolchainManager.isToolchainPathReady(toolchain.name)) { const dir = toolchainManager.getToolchainExecutableFolder(toolchain.name); - const msg = view_str$prompt$not_found_compiler.replace('{}', toolchain.name) + `, [path]: '${dir?.path}'`; - ResInstaller.instance().setOrInstallTools(toolchain.name, msg, toolchain.settingName); + let tooldisplayname: string = toolchain.name; + if (isGccFamilyToolchain(toolchain.name) && toolchain.getToolchainPrefix) + tooldisplayname = `${toolchain.getToolchainPrefix()}gcc`; + if (toolchain.name == 'ANY_GCC') { + const msg = view_str$prompt$not_found_gcc_prompt_user_setup.replace('{}', tooldisplayname); + vscode.window.showWarningMessage(msg); + } else { + const msg = view_str$prompt$not_found_compiler.replace('{}', tooldisplayname) + `, [path]: '${dir?.path}'`; + ResInstaller.instance().setOrInstallTools(toolchain.name, msg, toolchain.settingName); + } return false; } + return true; } @@ -3607,6 +3620,14 @@ class EIDEProject extends AbstractProject { // --- vscode settings + // 避免 msys bash 出现 cygpath 问题 + if (SettingManager.instance().isEnableMsys()) + settings['terminal.integrated.shellIntegration.enabled'] = false; + + // 默认不要自动插入 header + if (settings["clangd.arguments"] == undefined) + settings["clangd.arguments"] = ["--header-insertion=never"]; + if (settings['files.autoGuessEncoding'] === undefined) { settings['files.autoGuessEncoding'] = true; } @@ -3718,13 +3739,13 @@ class EIDEProject extends AbstractProject { GlobalEvent.emit('msg', ExceptionToMessage(error, 'Hidden')); } - // gen default 'settings.json' - try { - const settingsFile = File.fromArray([this.GetRootDir().path, AbstractProject.vsCodeDir, 'settings.json']); - if (!settingsFile.IsFile()) { settingsFile.Write('{}'); } - } catch (error) { - // nothing todo - } + // // gen default 'settings.json' + // try { + // const settingsFile = File.fromArray([this.GetRootDir().path, AbstractProject.vsCodeDir, 'settings.json']); + // if (!settingsFile.IsFile()) { settingsFile.Write('{}'); } + // } catch (error) { + // // nothing todo + // } // add extension recommendation { @@ -3737,8 +3758,7 @@ class EIDEProject extends AbstractProject { "redhat.vscode-yaml", "IBM.output-colorizer", "cschlosser.doxdocgen", - "ms-vscode.vscode-serial-monitor", - "alefragnani.project-manager" + "ms-vscode.vscode-serial-monitor" ]; const prjInfo = this.GetConfiguration().config; diff --git a/src/EIDEProjectExplorer.ts b/src/EIDEProjectExplorer.ts index 69905801..336a118b 100644 --- a/src/EIDEProjectExplorer.ts +++ b/src/EIDEProjectExplorer.ts @@ -1373,6 +1373,7 @@ class ProjectDataProvider implements vscode.TreeDataProvider, vsco } } break; + // The edit setting value's callback is in @ref ModifyOtherSettings(...) case TreeItemType.SETTINGS: { const config = project.GetConfiguration(); @@ -1841,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); @@ -1957,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: @@ -2159,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); } @@ -3986,7 +3950,7 @@ export class ProjectExplorer implements CustomConfigurationProvider { // cfg['CompileFlags']['CompilationDatabase'] = './' + File.ToUnixPath(prj.getOutputDir()); const toolchain = prj.getToolchain(); - const gccLikePath = toolchain.getGccFamilyCompilerPathForCpptools('c++'); + const gccLikePath = toolchain.getGccFamilyCompilerPathForCpptools('c'); if (gccLikePath) { // clangd 仅兼容gcc的编译器 cfg['CompileFlags']['Compiler'] = gccLikePath; let clangdCompileFlags = (cfg['CompileFlags']['Add']); @@ -4998,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) { @@ -5074,6 +5041,7 @@ export class ProjectExplorer implements CustomConfigurationProvider { const cfg: SimpleUIConfig = { title: 'Project Variables', + ref_id: `:${prj.getUid()}`, readonly: true, btns: { submit: { @@ -5392,6 +5360,7 @@ export class ProjectExplorer implements CustomConfigurationProvider { inheritedArgs = inheritedArgs.trim(); const ui_cfg: SimpleUIConfig = { + ref_id: `:${fspath}`, title: isChinese ? `修改编译选项(文件:${NodePath.basename(fspath)})` : `Modify Compiler Options (file: ${NodePath.basename(fspath)})`, @@ -5686,7 +5655,7 @@ export class ProjectExplorer implements CustomConfigurationProvider { } } - if (Object.keys(memoryAssign[pattern]).length === 0) { + if (memoryAssign[pattern] && Object.keys(memoryAssign[pattern]).length === 0) { delete memoryAssign[pattern]; // remove empty assign } @@ -5751,6 +5720,7 @@ export class ProjectExplorer implements CustomConfigurationProvider { inheritedOptions = inheritedOptions.trim(); const ui_cfg: SimpleUIConfig = { + ref_id: `:${folderpath}`, title: isChinese ? `修改编译选项(目录:${NodePath.basename(folderpath)})` : `Modify Compiler Options (dir: ${NodePath.basename(folderpath)})`, @@ -7340,7 +7310,7 @@ export class ProjectExplorer implements CustomConfigurationProvider { } } - async onConfigureToolchain(item: ProjTreeItem) { + async onSetupToolchain(item: ProjTreeItem) { const project = this.dataProvider.GetProjectByIndex(item.val.projectIndex); const setting = SettingManager.GetInstance(); @@ -7348,33 +7318,28 @@ export class ProjectExplorer implements CustomConfigurationProvider { let toolchainPathSettingName = setting.trimSettingTag(project.getToolchain().settingName); let toolchainPath = setting.getConfiguration().get(toolchainPathSettingName) || ''; - let cfg: SimpleUIConfig = { - title: 'Toolchain Configurations', - items: { - 'path': { - type: 'input', - attrs: { - singleLine: true, - }, - name: 'Toolchain Path', - data: { - placeHolder: 'toolchain dir, like: ${userRoot}/.eide/tools/', - value: toolchainPath, - default: toolchainPath - } - } - } + const toolchain = project.getToolchain(); + const isChinese = getLocalLanguageType() == LanguageIndexs.Chinese; + + const cfg: SimpleUIConfig = { + ref_id: `:${project.getUid()}`, + title: isChinese + ? `设置工具链 (项目:${project.getProjectName()})` + : `Setup Toolchain (Project: ${project.getProjectName()})`, + items: {} }; - let toolchainPrefix = setting.getGccFamilyToolPrefix(project.getToolchain().name); - if (toolchainPrefix != undefined) { + if (isGccFamilyToolchain(toolchain.name) && toolchain.getToolchainPrefix) { + const toolchainPrefix = toolchain.getToolchainPrefix() || ''; cfg.items['prefix'] = { type: 'input', attrs: { singleLine: true, size: 30, }, - name: 'Toolchain Prefix', + name: isChinese + ? '编译器前缀' + : 'Toolchain Prefix', data: { placeHolder: 'like: arm-none-eabi-', value: toolchainPrefix, @@ -7383,6 +7348,34 @@ export class ProjectExplorer implements CustomConfigurationProvider { }; } + // toolchain path + cfg.items['path'] = { + type: 'input', + attrs: { + singleLine: true, + }, + name: isChinese ? '编译器根目录位置' : 'Toolchain Path', + data: { + placeHolder: 'toolchain dir, like: ${userHome}/.eide/tools/', + value: toolchainPath, + default: toolchainPath + } + }; + + if (isGccFamilyToolchain(toolchain.name)) { + cfg.items['path_note'] = { + type: 'text', + attrs: {}, + name: '', + data: { + subType: 'raw', + value: isChinese + ? `提示:如果您已经将编译器 bin 目录设置到系统环境变量中,则您无需设置上述路径,重启工作区,插件将自动搜索可用的路径` + : `Note: If you have already set the compiler bin directory to the system environment variables, you do not need to set the above path. Restart the workspace, and the plugin will automatically search for available paths.` + }, + }; + } + WebPanelManager.instance().showSimpleConfigUI(cfg, async (newCfg) => { // update toolchain path @@ -7648,7 +7641,9 @@ export class ProjectExplorer implements CustomConfigurationProvider { const isChinese = getLocalLanguageType() == LanguageIndexs.Chinese; const ui: SimpleUIConfig = { - title: (isChinese ? '创建 Cortex-Debug ({}) 调试配置模板' : 'Create Cortex-Debug ({}) Configuration Template').replace('{}', type.toUpperCase()), + title: (isChinese + ? '创建 Cortex-Debug ({}) 调试配置模板' + : 'Create Cortex-Debug ({}) Configuration Template').replace('{}', type.toUpperCase()), viewColumn: vscode.ViewColumn.One, notTakeFocus: false, btns: { 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/Platform.ts b/src/Platform.ts index 0e04f331..4cdb19b5 100644 --- a/src/Platform.ts +++ b/src/Platform.ts @@ -169,7 +169,7 @@ export function GetUUID(): string { const list = buf.match(/[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}/); uuid = list ? list[0] : UUID_NULL; } else { - uuid = child_process.execSync(`cat /proc/sys/kernel/random/uuid`).toString().trim(); + uuid = 'machine-id-' + child_process.execSync(`cat /etc/machine-id`).toString().trim(); } } catch (error) { uuid = UUID_NULL; diff --git a/src/ResInstaller.ts b/src/ResInstaller.ts index 6d0d0370..476828a6 100644 --- a/src/ResInstaller.ts +++ b/src/ResInstaller.ts @@ -464,7 +464,7 @@ export class ResInstaller { // update eide settings if (toolInfo.setting_name) { - let setting_val = ['${userRoot}', '.eide', 'tools', resourceName].join(File.sep); + let setting_val = ['${userHome}', '.eide', 'tools', resourceName].join(File.sep); setting_val = toolInfo.require_name ? `${setting_val}/${toolInfo.require_name}` : setting_val; SettingManager.GetInstance().setConfigValue(toolInfo.setting_name, File.ToUnixPath(setting_val)); } diff --git a/src/ResManager.ts b/src/ResManager.ts index dc68d5d1..7e02fc2d 100644 --- a/src/ResManager.ts +++ b/src/ResManager.ts @@ -25,7 +25,7 @@ import { File } from "../lib/node-utility/File"; import { WorkspaceManager } from "./WorkspaceManager"; import { GlobalEvent } from "./GlobalEvents"; -import { exeSuffix, GetLocalCodePage, osType, getArchId, userhome } from "./Platform"; +import { exeSuffix, GetLocalCodePage, osType, getArchId, userhome, find } from "./Platform"; import { ExceptionToMessage } from "./Message"; import * as ChildProcess from 'child_process'; @@ -259,6 +259,9 @@ export class ResManager extends events.EventEmitter { } } + /** + * 按照文件名字,在 /tmp/EIDE 目录下寻找缓存的临时文件 + */ getCachedFileByName(name: string): File { return new File(this.GetTmpDir().path + File.sep + name); } @@ -274,13 +277,6 @@ export class ResManager extends events.EventEmitter { } } - GetHostInfo(): HostInfo { - return { - host: "47.240.52.92", - port: 50000 - }; - } - GetIconByName(name: string): File { let f = this.iconMap.get(name); @@ -325,6 +321,14 @@ export class ResManager extends events.EventEmitter { return process.env['ComSpec']; } + getPython3(): string { + if (osType() == 'win32') { + return File.from(userhome(), '.eide', 'bin', 'python36', 'python3.exe').path; + } else { + return find('python3') || 'python'; + } + } + //----------------------------------------------------------------- getAppRootFolder(): File { @@ -390,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'); + } + + getKeilC51ForceIncludeHeaders(): File { + return File.from(this.GetAppDataDir().path, 'builtin_headers', 'lint_keilc51.h'); } - getC51ForceIncludeHeaders(): File { - return File.fromArray([(this.GetDir('include')).path, 'internal_headers', 'c51_intr.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/SettingManager.ts b/src/SettingManager.ts index c117bc40..67ee2332 100644 --- a/src/SettingManager.ts +++ b/src/SettingManager.ts @@ -821,22 +821,6 @@ export class SettingManager { } } - getGccFamilyToolPrefix(id: ToolchainName): string | undefined { - switch (id) { - case 'GCC': - return this.getGCCPrefix(); - case 'RISCV_GCC': - return this.getRiscvToolPrefix(); - case 'ANY_GCC': - return this.getAnyGccToolPrefix(); - case 'MIPS_GCC': - case 'MTI_GCC': - return this.getMipsToolPrefix(); - default: - return undefined; - } - } - //------------------------------- C51 ---------------------------------- SetC51IniOrUv4Path(path: string) { diff --git a/src/SimpleUIDef.ts b/src/SimpleUIDef.ts index 44a4aced..3ef57796 100644 --- a/src/SimpleUIDef.ts +++ b/src/SimpleUIDef.ts @@ -4,6 +4,8 @@ export interface SimpleUIConfig { title: string; // title for this config + ref_id?: string; // 用于唯一地标识该配置,避免重复打开两个完全一样的配置 + readonly?: boolean; iconName?: string; diff --git a/src/StringTable.ts b/src/StringTable.ts index 74d721f3..ae34facb 100644 --- a/src/StringTable.ts +++ b/src/StringTable.ts @@ -381,8 +381,8 @@ export const set_device_hint = [ ][langIndex]; export const switch_workspace_hint = [ - '项目加载成功, 是否立即切换工作区 ?', - 'The project load successfully, do you want to switch workspace immediately ?' + '项目加载成功, 是否立即切换工作区 ? (需要切换工作区才能加载工作区配置)', + 'The project load successfully, do you want to switch workspace immediately ? Need to switch workspace so that the workspace configuration can be loaded.' ][langIndex]; //--------------- env --------------- @@ -413,8 +413,8 @@ export const view_str$env_desc$toolchain_root = [ ][langIndex]; export const view_str$env_desc$compiler_prefix = [ - `编译器前缀,例如:arm-none-eabi-`, - `Compiler prefix, like: arm-none-eabi-` + `GCC编译器前缀 (非GCC则没有前缀,为空),例如:arm-none-eabi-`, + `GCC Compiler Prefix (empty if it's not gcc). e.g. arm-none-eabi-` ][langIndex]; export const view_str$env_desc$compiler_folder = [ @@ -422,6 +422,36 @@ export const view_str$env_desc$compiler_folder = [ `Compiler executable file's folder` ][langIndex]; +export const view_str$env_desc$compiler_ver = [ + `编译器版本号,如:'8.3.1'`, + `Compiler Version. e.g. 8.3.1` +][langIndex]; + +export const view_str$env_desc$compiler_full_name = [ + `编译器全名 (可读名称)`, + `Compiler Full Name (Human-readable Name)` +][langIndex]; + +export const view_str$env_desc$cc_base_args = [ + `C 编译器的基本参数 (CFLAGS)`, + `Base C Compiler Flags (CFLAGS)` +][langIndex]; + +export const view_str$env_desc$cxx_base_args = [ + `C++ 编译器的基本参数 (CXXFLAGS)`, + `Base C++ Compiler Flags (CXXFLAGS)` +][langIndex]; + +export const view_str$env_desc$asm_base_args = [ + `汇编器的基本参数 (ASMFLAGS)`, + `Base Assembler Flags (ASMFLAGS)` +][langIndex]; + +export const view_str$env_desc$py3_cmd = [ + `插件内置的 python3 命令 (非windows平台则使用系统自带命令)`, + `The built-in python3 commands of the plugin (for non-Windows platforms, use the system's built-in commands)` +][langIndex]; + //---------------Other--------------- export const view_str$gen_sct_failed = [ @@ -549,10 +579,15 @@ export const view_str$prompt$select_file_or_folder = [ ][langIndex]; export const view_str$prompt$not_found_compiler = [ - `无法找到编译器 '{}' 的安装位置 !`, + `无法找到编译器 '{}' 的位置 !`, `Not found the compiler '{}' location !` ][langIndex]; +export const view_str$prompt$not_found_gcc_prompt_user_setup = [ + `无法找到编译器 '{}' 的位置 !\n请确保编译器已安装,并设置到系统环境变量 PATH 中。\n右击 '构建配置' 打开 '设置工具链' 检查编译器前缀是否已设置。`, + `Not found the compiler '{}' location ! \nPlease ensure that the compiler is installed and set to the system 'PATH' environment variable.\nRight-click on 'Builder Configuration' to open 'Setup Toolchain' and check if the compiler prefix has been set.` +][langIndex]; + export const view_str$prompt$install_tools_by_online = [ `已找到在线资源包,需要安装它吗?`, `The online package was found. Do you want to install it ?` diff --git a/src/ToolchainManager.ts b/src/ToolchainManager.ts index 69621826..9ceccd9b 100644 --- a/src/ToolchainManager.ts +++ b/src/ToolchainManager.ts @@ -30,14 +30,11 @@ import { GlobalEvent } from "./GlobalEvents"; import { newMessage, ExceptionToMessage } from "./Message"; import { ARMCodeBuilder } from "./CodeBuilder"; import * as platform from './Platform'; - import * as child_process from 'child_process'; -import { CmdLineHandler } from "./CmdLineHandler"; import * as fs from 'fs'; import * as events from 'events'; import * as NodePath from 'path'; -import * as os from 'os'; -import { ArmBaseBuilderConfigData, ArmBaseCompileData, RiscvBuilderConfigData } from "./EIDEProjectModules"; +import { ArmBaseBuilderConfigData } from "./EIDEProjectModules"; import * as utility from "./utility"; import * as ArmCpuUtils from "./ArmCpuUtils"; @@ -160,6 +157,11 @@ export interface IToolchian { getDefaultConfig(): BuilderOptions; + /** + * 用于配置项迁移,需要升级旧项目的 builder options 时,执行该方法 + */ + migrateOptions?: (oldOptions: BuilderOptions) => void; + newInstance(): IToolchian; } @@ -328,7 +330,7 @@ export class ToolchainManager { // 在 builder options 版本升级后,通过该函数对旧配置进行更新 // @return 返回升级后配置,如果为空,则无需升级 - upgradeBuilderOptions(curOption: BuilderOptions, toolchain: IToolchian): BuilderOptions | undefined { + migrateBuilderOptions(curOption: BuilderOptions, toolchain: IToolchian): BuilderOptions | undefined { try { // if exist if (curOption.version != undefined) { @@ -337,9 +339,6 @@ export class ToolchainManager { const defOptions: BuilderOptions = toolchain.getDefaultConfig(); - // update version - curOption.version = defOptions.version; - // compatible some linker old params if (curOption.linker) { // sdcc: rename 'executable-format' @@ -394,6 +393,13 @@ export class ToolchainManager { } } + if (toolchain.migrateOptions) + toolchain.migrateOptions(curOption); + + // update version + curOption.version = defOptions.version; + + GlobalEvent.log_info('migrate builderOptions done.'); return curOption; } return undefined; @@ -401,7 +407,10 @@ export class ToolchainManager { return toolchain.getDefaultConfig(); } } catch (error) { - GlobalEvent.emit('msg', ExceptionToMessage(error, 'Hidden')); + const msg = `Fail to migrate builderOptions. see log for details.`; + GlobalEvent.emit('msg', newMessage('Error', msg)); + GlobalEvent.log_error(error); + GlobalEvent.log_show(); } } @@ -481,7 +490,7 @@ class KeilC51 implements IToolchian { getForceIncludeHeaders(): string[] | undefined { return [ - ResManager.GetInstance().getC51ForceIncludeHeaders().path + ResManager.GetInstance().getKeilC51ForceIncludeHeaders().path ]; } @@ -1114,7 +1123,7 @@ class SDCC implements IToolchian { getForceIncludeHeaders(): string[] | undefined { return [ - ResManager.GetInstance().getC51ForceIncludeHeaders().path + ResManager.GetInstance().getSdccForceIncludeHeaders().path ]; } @@ -1749,6 +1758,7 @@ class AC5 implements IToolchian { }, 'asm-compiler': {}, linker: { + "$outputTaskExcludes": [".bin"], "output-format": 'elf' } }; @@ -1907,6 +1917,30 @@ class AC6 implements IToolchian { if (options['c/cpp-compiler'] && options['c/cpp-compiler']['link-time-optimization']) { options['linker']['link-time-optimization'] = options['c/cpp-compiler']['link-time-optimization']; } + + // AC6 的汇编器模式: + // - armclang (GNU Syntax):使用 armclang 来编译汇编源代码(对应命令行选项 -masm=gnu),然后强制使用 GNU 汇编语法风格 + // - armclang (Arm Syntax):使用armclang来编译汇编源代码(对应命令行选项 -masm=armasm),然后强制使用 UAL 汇编语法风格。 + // - armclang(Auto Select):使用 armclang 来编译汇编源代码(对应命令行选项 -masm=auto) + //! 暂时废弃:因为使用 arm-clang -masm=auto 不能完全兼容旧的 .s 文件, + // --predefine 不等同于编译器选项 -Dname。--predefine 定义了一个全局变量,而 -Dname 定义了 C 预处理器扩展的宏。 + // 见:https://developer.arm.com/documentation/dui0473/m/assembler-command-line-options/--predefine--directive- + // 一些汇编文件中存在 `IF :DEF:__MICROLIB` 这需要一个全局变量定义而不是宏定义, + // - 对于 armasm 它提供 --pd "__MICROLIB SETA 1" 以设置变量 __MICROLIB + // - 对于 armclang 它使用了预处理器定义 -D__MICROLIB 并替换宏定义为值 1,但 .s 需要一个变量,因此出现 Symbol missing 错误 + // if (options['asm-compiler']) { + // // 选择 asm-auto 将使用 `armclang(Auto Select)` 模式,与 MDK 相同 + // if (options['asm-compiler']['$use'] == 'asm-auto') { + // options['asm-compiler']['$use'] = 'asm-clang'; + // options['asm-compiler']['masm'] = 'auto'; + // } + // } else { + // // 默认情况下,使用 arm-clang + -masm=auto + // options['asm-compiler'] = { + // '$use': 'asm-clang', + // 'masm': 'auto' + // }; + // } } getToolchainDir(): File { @@ -1970,9 +2004,11 @@ class AC6 implements IToolchian { "link-time-optimization": false }, 'asm-compiler': { - "$use": "asm-auto" + "$use": "asm-auto", + "misc-controls": "" }, linker: { + "$outputTaskExcludes": [".bin"], "output-format": 'elf', 'misc-controls': '--diag_suppress=L6329' } @@ -2225,6 +2261,7 @@ class GCC implements IToolchian { "ASM_FLAGS": "" }, linker: { + "$outputTaskExcludes": [".bin"], "output-format": "elf", "remove-unused-input-sections": true, "LD_FLAGS": "", @@ -2363,6 +2400,7 @@ class IARARM implements IToolchian { "case-sensitive-user-symbols": true }, 'linker': { + "$outputTaskExcludes": [".bin"], "output-format": 'elf', "auto-search-runtime-lib": true, "perform-cpp-virtual-func-elimination": "enable", @@ -2412,6 +2450,8 @@ class LLVM_ARM implements IToolchian { } private getToolPrefix(): string { + // FIXME + // Not support yet. return ''; } @@ -2428,10 +2468,6 @@ class LLVM_ARM implements IToolchian { return gcc.path; } - getToolchainPrefix(): string { - return this.getToolPrefix(); - } - private getCompilerTargetArgs(cpuName: string, fpuType: string, archExt: string, builderOpts: BuilderOptions): string[] { const result: string[] = []; @@ -2892,6 +2928,7 @@ class LLVM_ARM implements IToolchian { "ASM_FLAGS": "" }, linker: { + "$outputTaskExcludes": [".bin"], "output-format": "elf", "remove-unused-input-sections": true, "LD_FLAGS": "", @@ -3573,6 +3610,7 @@ class RISCV_GCC implements IToolchian { "ASM_FLAGS": "-Wl,-Bstatic" }, linker: { + "$outputTaskExcludes": [".bin"], "output-format": "elf", "remove-unused-input-sections": true, "LD_FLAGS": "-Wl,--cref -Wl,--no-relax -nostartfiles", @@ -3584,7 +3622,7 @@ class RISCV_GCC implements IToolchian { class AnyGcc implements IToolchian { - readonly version = 1; + readonly version = 2; readonly settingName: string = 'EIDE.Toolchain.AnyGcc.InstallDirectory'; @@ -3686,6 +3724,14 @@ class AnyGcc implements IToolchian { // pass user compiler args if (builderOpts["c/cpp-compiler"]) { + if (builderOpts["c/cpp-compiler"]['language-c']) { + cppToolsConfig.cStandard = builderOpts["c/cpp-compiler"]['language-c']; + } + + if (builderOpts["c/cpp-compiler"]['language-cpp']) { + cppToolsConfig.cppStandard = builderOpts["c/cpp-compiler"]['language-cpp']; + } + if (typeof builderOpts["c/cpp-compiler"]['C_FLAGS'] == 'string') { const pList = builderOpts['c/cpp-compiler']['C_FLAGS'].trim().split(/\s+/); cppToolsConfig.cCompilerArgs = pList; @@ -3785,37 +3831,66 @@ class AnyGcc implements IToolchian { return []; } + migrateOptions(options: BuilderOptions) { + + let cflags: string = options["c/cpp-compiler"]['C_FLAGS'] || ''; + let cxxflags: string = options["c/cpp-compiler"]['CXX_FLAGS'] || ''; + let asmflags: string = options["asm-compiler"]['ASM_FLAGS'] || ''; + let ldflags: string = options.linker['LD_FLAGS'] || ''; + + if (options.version == 1) { + // setup default options + options["global"]["output-debug-info"] = "enable"; + options["c/cpp-compiler"]["language-c"] = "c11"; + options["c/cpp-compiler"]["language-cpp"] = "gnu++11"; + options["c/cpp-compiler"]["signed-char"] = true; + options["linker"]["$disableOutputTask"] = true; + // remove -c -x options + cflags = cflags + .replace('-c -xc', '').trim(); + cxxflags = cxxflags + .replace('-c -xc++', '').trim(); + asmflags = asmflags + .replace('-c', '').trim(); + // replace '--print-memory-usage' + if (ldflags.includes('--print-memory-usage')) { + ldflags = ldflags.replace(/(-Wl,)?--print-memory-usage/, '').trim(); + options["linker"]['print-mem-usage'] = true; + } + } + + // update + options["c/cpp-compiler"]['C_FLAGS'] = cflags; + options["c/cpp-compiler"]['CXX_FLAGS'] = cxxflags; + options["asm-compiler"]['ASM_FLAGS'] = asmflags; + options.linker['LD_FLAGS'] = ldflags; + } + getDefaultConfig(): BuilderOptions { return { version: this.version, beforeBuildTasks: [], - afterBuildTasks: [ - { - "name": "make hex", - "disable": true, - "abortAfterFailed": false, - "command": "\"${CompilerFolder}/${CompilerPrefix}objcopy\" -O ihex \"${OutDir}/${TargetName}.elf\" \"${OutDir}/${TargetName}.hex\"" - }, - { - "name": "make bin", - "disable": true, - "abortAfterFailed": false, - "command": "\"${CompilerFolder}/${CompilerPrefix}objcopy\" -O binary \"${OutDir}/${TargetName}.elf\" \"${OutDir}/${TargetName}.bin\"" - } - ], - global: {}, + afterBuildTasks: [], + global: { + "output-debug-info": "enable" + }, 'c/cpp-compiler': { + "language-c": "c11", + "language-cpp": "gnu++11", "one-elf-section-per-function": true, "one-elf-section-per-data": true, - "C_FLAGS": "-c -xc", - "CXX_FLAGS": "-c -xc++" + "signed-char": true, + "C_FLAGS": "", + "CXX_FLAGS": "" }, 'asm-compiler': { - "ASM_FLAGS": "-c" + "ASM_FLAGS": "" }, linker: { "output-format": "elf", + "$disableOutputTask": true, "remove-unused-input-sections": true, + "print-mem-usage": true, "LD_FLAGS": "", "LIB_FLAGS": "" } diff --git a/src/WebPanelManager.ts b/src/WebPanelManager.ts index 50a5afed..7d79a8b0 100644 --- a/src/WebPanelManager.ts +++ b/src/WebPanelManager.ts @@ -28,7 +28,16 @@ import { ResManager } from "./ResManager"; import { AbstractProject } from "./EIDEProject"; import { ArmBaseCompileConfigModel } from "./EIDEProjectModules"; import { GlobalEvent } from "./GlobalEvents"; -import { view_str$compile$options, view_str$compile$storageLayout, view_str$env_desc$builer_folder, view_str$env_desc$compiler_folder, view_str$env_desc$compiler_prefix, view_str$env_desc$output_dir, view_str$env_desc$project_name, view_str$env_desc$project_root, view_str$env_desc$toolchain_root, view_str$operation$done, view_str$project$cmsis_config_wizard } from "./StringTable"; +import { view_str$compile$options, view_str$compile$storageLayout, + view_str$env_desc$builer_folder, view_str$env_desc$compiler_folder, + view_str$env_desc$compiler_prefix, view_str$env_desc$output_dir, + view_str$env_desc$project_name, view_str$env_desc$project_root, + view_str$env_desc$toolchain_root, view_str$operation$done, + view_str$project$cmsis_config_wizard, view_str$env_desc$py3_cmd, + view_str$env_desc$cc_base_args, view_str$env_desc$cxx_base_args, + view_str$env_desc$asm_base_args, view_str$env_desc$compiler_ver, + view_str$env_desc$compiler_full_name +} from "./StringTable"; import * as NodePath from 'path'; import * as CmsisConfigParser from './CmsisConfigParser' import * as os from 'os' @@ -43,6 +52,11 @@ let _instance: WebPanelManager; export class WebPanelManager { + private builderOptionViewRef: Map = new Map(); + private memoryLayoutViewRef: Map = new Map(); + private cmsisHeaderViewRef: Map = new Map(); + private simpleConfigViewRef: Map = new Map(); + private constructor() { } @@ -57,6 +71,12 @@ export class WebPanelManager { onSubmit: (newCfg: SimpleUIConfig, thisPanel: vscode.WebviewPanel) => Promise, onMsg?: (msg: string, thisPanel: vscode.WebviewPanel) => void): vscode.WebviewPanel { + const oldpanel = cfg.ref_id ? this.simpleConfigViewRef.get(cfg.ref_id) : undefined; + if (oldpanel) { + oldpanel.reveal(); + return oldpanel; + } + const resManager = ResManager.GetInstance(); let ViewCol = cfg.viewColumn; @@ -70,6 +90,15 @@ export class WebPanelManager { { viewColumn: ViewCol, preserveFocus: cfg.notTakeFocus }, { enableScripts: true, retainContextWhenHidden: true }); + if (cfg.ref_id) { + const uid = cfg.ref_id; + this.simpleConfigViewRef.set(uid, panel); + panel.onDidDispose(() => { + console.log(`[eide] onDidDispose simpleConfigView for ${uid}`); + this.simpleConfigViewRef.delete(uid); + }); + } + panel.iconPath = vscode.Uri.file(resManager.GetIconByName(cfg.iconName || 'Property_16x.svg').path); panel.webview.onDidReceiveMessage(async (_data: any) => { @@ -115,17 +144,25 @@ export class WebPanelManager { showStorageLayoutView(project: AbstractProject): void { - const resManager = ResManager.GetInstance(); + const oldpanel = this.memoryLayoutViewRef.get(project.getUid()); + if (oldpanel) { + oldpanel.reveal(); + return; + } + const resManager = ResManager.GetInstance(); const panel = vscode.window.createWebviewPanel('MemoryLayoutView', view_str$compile$storageLayout, vscode.ViewColumn.One, { enableScripts: true, retainContextWhenHidden: true }); + this.memoryLayoutViewRef.set(project.getUid(), panel); + // set web icon panel.iconPath = vscode.Uri.parse(resManager.GetIconByName('Memory_16x.svg').ToUri()); panel.onDidDispose(() => { - //TODO + console.log(`[eide] onDidDispose memoryLayoutView for ${project.getRootDir().path}`); + this.memoryLayoutViewRef.delete(project.getUid()); }); const compileModel = project.GetConfiguration().compileConfigModel; @@ -174,6 +211,12 @@ export class WebPanelManager { showBuilderOptions(project: AbstractProject): void { + const oldpanel = this.builderOptionViewRef.get(project.getUid()); + if (oldpanel) { + oldpanel.reveal(); + return; + } + const projectConfig = project.GetConfiguration(); const resManager = ResManager.GetInstance(); const htmlFolder = File.fromArray([resManager.GetHTMLDir().path, 'builder_options']); @@ -191,16 +234,17 @@ export class WebPanelManager { panelOptions ); + this.builderOptionViewRef.set(project.getUid(), panel); + // init panel data panel.iconPath = vscode.Uri.parse(resManager.GetIconByName('Property_16x.svg').ToUri()); const envList: any[] = [ // unify_builder specific variables - { name: '${BuilderFolder}', desc: view_str$env_desc$builer_folder }, { name: '${CompilerPrefix}', desc: view_str$env_desc$compiler_prefix }, - { name: '${CompilerFolder}', desc: view_str$env_desc$compiler_folder } + { name: '${CompilerFullName}', desc: view_str$env_desc$compiler_full_name }, + { name: '${CompilerVersion}', desc: view_str$env_desc$compiler_ver } ]; - const prjEnv = project.getProjectVariables(); for (const key in prjEnv) { envList.push({ @@ -208,6 +252,12 @@ export class WebPanelManager { desc: `${prjEnv[key]}` }) } + // other EIDE_xx variables + [ + { name: '${EIDE_CUR_COMPILER_CC_BASE_ARGS}', desc: view_str$env_desc$cc_base_args }, + { name: '${EIDE_CUR_COMPILER_CXX_BASE_ARGS}', desc: view_str$env_desc$cxx_base_args }, + { name: '${EIDE_CUR_COMPILER_AS_BASE_ARGS}', desc: view_str$env_desc$asm_base_args } + ].forEach(item => envList.push(item)) const toolchain = project.getToolchain(); @@ -232,7 +282,8 @@ export class WebPanelManager { } panel.onDidDispose(() => { - // TODO + console.log(`[eide] onDidDispose builderOptionView for ${project.getRootDir().path}`); + this.builderOptionViewRef.delete(project.getUid()); }); panel.webview.onDidReceiveMessage(async (data) => { @@ -305,6 +356,12 @@ export class WebPanelManager { showCmsisConfigWizard(uri: vscode.Uri): void { + const oldpanel = this.cmsisHeaderViewRef.get(uri.fsPath); + if (oldpanel) { + oldpanel.reveal(); + return; + } + // get current encoding for this file const fencoding = vscode.workspace.getConfiguration(undefined, uri).get('files.encoding') || 'utf8'; const inputFile = new File(uri.fsPath); @@ -348,6 +405,8 @@ export class WebPanelManager { panelOptions ); + this.cmsisHeaderViewRef.set(uri.fsPath, panel); + // init panel data panel.iconPath = vscode.Uri.parse(resManager.GetIconByName('Property_16x.svg').ToUri()); @@ -358,7 +417,8 @@ export class WebPanelManager { }; panel.onDidDispose(() => { - // TODO + console.log(`[eide] onDidDispose CmsisConfigWizard for ${uri.fsPath}`); + this.cmsisHeaderViewRef.delete(uri.fsPath); }); panel.webview.onDidReceiveMessage((data) => { diff --git a/src/extension.ts b/src/extension.ts index 143ba5fd..3b948102 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -228,7 +228,7 @@ export async function activate(context: vscode.ExtensionContext) { subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.modifyCompileConfig', (item) => projectExplorer.ModifyCompileConfig(item))); subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.modifyCompileConfig.openFile', (item) => projectExplorer.ModifyCompileConfig_openFile(item))); subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.switchToolchain', (item) => projectExplorer.onSwitchCompileTools(item))); - subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.configToolchain', (item) => projectExplorer.onConfigureToolchain(item))); + subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.setupToolchain', (item) => projectExplorer.onSetupToolchain(item))); // flasher subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.modifyUploadConfig', (item) => projectExplorer.ModifyUploadConfig(item))); @@ -315,7 +315,7 @@ function postLaunchHook(extensionCtx: vscode.ExtensionContext) { if (isFirstLaunch) { // setup install time - resManager.setAppUsrData('InstallTime', Date.now().toString()); + resManager.setAppUsrData('InstallTime', Date.now()); // only enable github proxy for GMT+8:00 by default const timeZone = Math.floor((new Date().getTimezoneOffset() / 60) * -1); @@ -328,10 +328,16 @@ function postLaunchHook(extensionCtx: vscode.ExtensionContext) { // not first launch else { + // fix type error for old version + if (typeof appUsrData['InstallTime'] === 'string') { + appUsrData['InstallTime'] = parseInt(appUsrData['InstallTime']) || 0; + resManager.setAppUsrData('InstallTime', appUsrData['InstallTime']); + } + // A few days ago, show feedback message - const some_days = 7 * (24 * 3600 * 1000); + const some_days = 7 * utility.TIME_ONE_DAY; if (!appUsrData['Feedbacked'] && - Date.now() - appUsrData['InstallTime'] > some_days) { + Date.now() > appUsrData['InstallTime'] + some_days) { resManager.setAppUsrData('Feedbacked', true); const msg = view_str$prompt$feedback; vscode.window.showInformationMessage(msg, rating_text, sponsor_author_text).then((ans) => { @@ -433,9 +439,10 @@ async function checkAndInstallBinaries(forceInstall?: boolean): Promise } /* check eide binaries */ - // if user force reinstall, delete old 'bin' dir + + // force reinstall if (forceInstall) { - platform.DeleteDir(binFolder); + return await tryUpdateBinaries(binFolder, undefined); } // if binaries is installed, we need check binaries's version @@ -461,12 +468,18 @@ async function checkAndInstallBinaries(forceInstall?: boolean): Promise // try fetch update after 5sec delay if (localVersion) { setTimeout(async (curLocalVersion: string) => { - const done = await tryUpdateBinaries(binFolder, curLocalVersion, true); // no prompt - if (!done) { - const msg = `Update eide-binaries failed, please restart vscode to try again !`; - const sel = await vscode.window.showErrorMessage(msg, 'Restart', 'Cancel'); - if (sel == 'Restart') { - vscode.commands.executeCommand('workbench.action.reloadWindow'); + const appUsrData = resManager.getAppUsrData() || {}; + const lastCheckUpdateTime: number = appUsrData['LastCheckBinariesUpdateTime'] || 0; + if (Date.now() > lastCheckUpdateTime + (6 * utility.TIME_ONE_HOUR)) { + const done = await tryUpdateBinaries(binFolder, curLocalVersion); // no prompt + if (done) { + resManager.setAppUsrData('LastCheckBinariesUpdateTime', Date.now()); + } else { + const msg = `Update eide-binaries failed, please restart vscode to try again !`; + const sel = await vscode.window.showErrorMessage(msg, 'Restart', 'Cancel'); + if (sel == 'Restart') { + vscode.commands.executeCommand('workbench.action.reloadWindow'); + } } } }, 5 * 1000, localVersion); @@ -476,7 +489,7 @@ async function checkAndInstallBinaries(forceInstall?: boolean): Promise // the binaries maybe damaged, we need to force reinstall it else { platform.DeleteDir(binFolder); // del existed folder - return await tryUpdateBinaries(binFolder, undefined, true); + return await tryUpdateBinaries(binFolder, undefined); } // export current binaries version @@ -491,10 +504,13 @@ async function checkAndInstallBinaries(forceInstall?: boolean): Promise } // not found binaries folder, install it - return await tryUpdateBinaries(binFolder, undefined, true); + return await tryUpdateBinaries(binFolder, undefined); } -async function tryUpdateBinaries(binFolder: File, localVer?: string, notConfirm?: boolean): Promise { +/** + * @param localVer 当前本地的版本号,通过比对版本号决定是否执行安装,如果为 undefined 则强制安装 +*/ +async function tryUpdateBinaries(binFolder: File, localVer?: string): Promise { const eideCfg = ResManager.GetInstance().getAppConfig(); const minReqVersion = eideCfg['binary_min_version']; @@ -578,15 +594,12 @@ async function tryUpdateBinaries(binFolder: File, localVer?: string, notConfirm? // check bin folder // show notify to user and request a confirm if (checkBinFolder(binFolder) && preinstallVersion) { - - if (!notConfirm) { - const msg = `New update for eide binaries, version: '${preinstallVersion}', [ChangeLog](https://github.com/github0null/eide-resource/pulls?q=is%3Apr+is%3Aclosed), install now ?`; - const sel = await vscode.window.showInformationMessage(msg, 'Yes', 'Later'); - if (sel != 'Yes') { return true; } // user canceled - } - - // del old bin folder before install - platform.DeleteDir(binFolder); + //TODO + // if (!notConfirm) { + // const msg = `New update for eide binaries, version: '${preinstallVersion}', [ChangeLog](https://github.com/github0null/eide-resource/pulls?q=is%3Apr+is%3Aclosed), install now ?`; + // const sel = await vscode.window.showInformationMessage(msg, 'Yes', 'Later'); + // if (sel != 'Yes') { return true; } // user canceled + // } } return await tryInstallBinaries(binFolder, preinstallVersion); @@ -615,9 +628,6 @@ async function tryInstallBinaries(binFolder: File, binVersion: string): Promise< try { const tmpFile = File.fromArray([os.tmpdir(), `eide-binaries-${binVersion}.${binType}`]); - /* make dir */ - binFolder.CreateDir(true); - const done = await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: 'Downloading eide binaries', @@ -666,6 +676,15 @@ async function tryInstallBinaries(binFolder: File, binVersion: string): Promise< let prevPercent: number = 0; + // del old binaries + if (binFolder.IsDir()) { + progress.report({ message: `Cleanup old files ...` }); + platform.DeleteAllChildren(binFolder); + } + + // make dir + binFolder.CreateDir(true); + // start unzip node7z.extractFull(tmpFile.path, binFolder.path, { $bin: ResManager.GetInstance().Get7za().path, @@ -900,6 +919,9 @@ function exportEnvToSysPath(context?: vscode.ExtensionContext) { } } + /* setup python3 cmd */ + process.env['EIDE_PY3_CMD'] = resManager.getPython3(); + // .NET 工具会收集用法数据,帮助我们改善你的体验。它由 Microsoft 收集并与社区共享。 // 你可通过使用喜欢的 shell 将 DOTNET_CLI_TELEMETRY_OPTOUT 环境变量设置为 "1" 或 "true" 来选择退出遥测。 // 阅读有关 .NET CLI 工具遥测的更多信息: https://aka.ms/dotnet-cli-telemetry diff --git a/src/utility.ts b/src/utility.ts index 2725e34f..dc03b638 100644 --- a/src/utility.ts +++ b/src/utility.ts @@ -45,6 +45,10 @@ import { SettingManager } from './SettingManager'; import { ToolchainName } from './ToolchainManager'; import { Time } from '../lib/node-utility/Time'; +export const TIME_ONE_MINUTE = 60 * 1000; +export const TIME_ONE_HOUR = 3600 * 1000; +export const TIME_ONE_DAY = 24 * 3600 * 1000; + /** * @param len len必须是2的整数倍 */ @@ -566,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;