Skip to content

Commit a26860e

Browse files
authored
Merge pull request #231 from github0null/dev
v3.11.3 update
2 parents 5e510e5 + 3d85baf commit a26860e

9 files changed

Lines changed: 128 additions & 55 deletions

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ All notable version changes will be recorded in this file.
66

77
***
88

9+
### [v3.11.3] revision
10+
11+
**Fix**:
12+
- `Extra Compiler Options`: Cannot evaluate inherited parameters.
13+
- `unify_builder`: Cannot handle more than one `args expressions` for file options.
14+
- `unify_builder`: Remove global extra options for `sdxxasm`.
15+
16+
**Optimize**:
17+
- `unify_builder`: More color render for compiler output messages.
18+
- `unify_builder`: Add 'ASM_FLAGS' for sdcc sdxxasm.
19+
- `Debug Config`: Auto generate toolchain prefix for cortex-debug.
20+
21+
**Please update `eide_binaries` to v11.0.1+ (Restart plug-in to auto fetch update).**
22+
23+
***
24+
925
### [v3.11.2] update
1026

1127
**New**:

lang/any.gcc.verify.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
}
180180
},
181181
"ASM_FLAGS": {
182-
"markdownDescription": "Assembler Params",
182+
"markdownDescription": "Assembler Options",
183183
"description.zh-cn": "汇编器参数",
184184
"$ref": "#/definitions/FLAGS",
185185
"default": "-c -x assembler"

lang/sdcc.verify.json

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@
1515
"type": "string"
1616
},
1717
"default": ""
18+
},
19+
"FLAGS": {
20+
"markdownDescription": "Options",
21+
"description.zh-cn": "选项",
22+
"size": "huge",
23+
"type": [
24+
"string",
25+
"array"
26+
],
27+
"items": {
28+
"type": "string"
29+
},
30+
"default": []
1831
}
1932
},
2033
"properties": {
@@ -185,16 +198,6 @@
185198
"size"
186199
]
187200
},
188-
"$one-module-per-function": {
189-
"type": "boolean",
190-
"markdownDescription": "Module Split Optimization (supported by eide)",
191-
"description.zh-cn": "模块拆分优化 (supported by eide)",
192-
"default": false,
193-
"enum": [
194-
true,
195-
false
196-
]
197-
},
198201
"plain-char-is-signed": {
199202
"type": "boolean",
200203
"markdownDescription": "plain char is signed",
@@ -351,10 +354,11 @@
351354
"description.zh-cn": "汇编器选项",
352355
"type": "object",
353356
"properties": {
354-
"misc-controls": {
355-
"markdownDescription": "Other Assembler Options",
356-
"description.zh-cn": "汇编器附加选项",
357-
"$ref": "#/definitions/misc-controls"
357+
"ASM_FLAGS": {
358+
"markdownDescription": "Assembler Options",
359+
"description.zh-cn": "汇编器参数",
360+
"$ref": "#/definitions/FLAGS",
361+
"default": ""
358362
}
359363
}
360364
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"homepage": "https://em-ide.com",
3636
"license": "MIT",
3737
"description": "A mcu development environment for 8051/AVR/STM8/Cortex-M/RISC-V",
38-
"version": "3.11.2",
38+
"version": "3.11.3",
3939
"preview": false,
4040
"engines": {
4141
"vscode": "^1.67.0"

package.nls.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"eide.project.upload": "Program Flash",
3030
"eide.project.flash.erase.all": "Erase Chip",
3131
"eide.project.gen.makefile": "Generate Makefile Template",
32-
"eide.project.modify.files.options": "Show Source Files Extra Compiler Args",
32+
"eide.project.modify.files.options": "Show Source Files Extra Compiler Options",
3333
"eide.project.import.ext.project.src.struct": "Import source tree from other projects",
3434
"eide.project.generate_builder_params": "Generate builder.params",
3535

@@ -67,8 +67,8 @@
6767
"eide.explorer.show.file.dir": "Show In File Explorer",
6868
"eide.explorer.modify.file.path": "Modify File Path",
6969
"eide.explorer.modify.exclude_list": "Modify Source File Exclude List",
70-
"eide.explorer.file.modify.extraArgs": "Modify Extra Compiler Args",
71-
"eide.explorer.folder.modify.extraArgs": "Modify Extra Compiler Args",
70+
"eide.explorer.file.modify.extraArgs": "Modify Extra Compiler Options",
71+
"eide.explorer.folder.modify.extraArgs": "Modify Extra Compiler Options",
7272

7373
"eide.source.show_cmsis_config_wizard": "CMSIS Configuration Wizard",
7474
"eide.source.show.disassembly": "Show Disassembly",

src/DebugConfigGenerator.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ class CortexDebugConfigProvider extends IDebugConfigProvider {
165165
// must use elf to debug
166166
debugConfig.executable = outDir + File.sep + prjConfig.name + '.elf';
167167

168+
const toolchain = prj.getToolchain();
169+
if (toolchain.getToolchainPrefix) {
170+
debugConfig.toolchainPrefix = toolchain.getToolchainPrefix().trim().replace(/-$/, '');
171+
} else if (debugConfig.toolchainPrefix) {
172+
debugConfig.toolchainPrefix = undefined;
173+
}
174+
168175
// setup svd file, if existed
169176
const device = prj.GetPackManager().getCurrentDevInfo();
170177
if (device && device.svdPath && debugConfig.svdFile == undefined) {

src/EIDEProject.ts

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1975,12 +1975,12 @@ export abstract class AbstractProject implements CustomConfigurationProvider, Pr
19751975
return false;
19761976
}
19771977

1978-
getExtraArgsForSource(fspath: string, virtpath?: string, cfg?: SourceExtraCompilerOptionsCfg): string[] | undefined {
1978+
getExtraArgsForSource(fspath: string, virtpath?: string, cfg?: SourceExtraCompilerOptionsCfg): { [expr: string]: string | undefined } {
19791979

19801980
if (cfg == undefined)
1981-
return undefined;
1981+
return {};
19821982

1983-
const extraArgs: string[] = [];
1983+
const extraArgs: { [expr: string]: string } = {};
19841984

19851985
// for fs path
19861986
if (cfg.files) {
@@ -1992,7 +1992,11 @@ export abstract class AbstractProject implements CustomConfigurationProvider, Pr
19921992
if (globmatch.isMatch(searchPath, expr)) {
19931993
const val = patterns[expr]?.replace(/\r\n|\n/g, ' ').replace(/\\r|\\n|\\t/g, ' ').trim();
19941994
if (val) {
1995-
extraArgs.push(val);
1995+
if (extraArgs[expr]) {
1996+
extraArgs[expr] = extraArgs[expr] + ' ' + val;
1997+
} else {
1998+
extraArgs[expr] = val;
1999+
}
19962000
}
19972001
}
19982002
}
@@ -2005,28 +2009,40 @@ export abstract class AbstractProject implements CustomConfigurationProvider, Pr
20052009
if (globmatch.isMatch(searchPath, expr)) {
20062010
const val = patterns[expr]?.replace(/\r\n|\n/g, ' ').replace(/\\r|\\n|\\t/g, ' ').trim();
20072011
if (val) {
2008-
extraArgs.push(val);
2012+
if (extraArgs[expr]) {
2013+
extraArgs[expr] = extraArgs[expr] + ' ' + val;
2014+
} else {
2015+
extraArgs[expr] = val;
2016+
}
20092017
}
20102018
}
20112019
}
20122020
}
20132021

2014-
return extraArgs.length > 0 ? extraArgs : undefined;
2022+
return extraArgs;
20152023
}
20162024

2017-
getExtraArgsForFolder(folderpath: string, isVirtpath?: boolean, cfg?: SourceExtraCompilerOptionsCfg): string[] | undefined {
2025+
getExtraArgsForFolder(folderpath: string, isVirtpath?: boolean, cfg?: SourceExtraCompilerOptionsCfg): { [expr: string]: string | undefined } {
20182026

20192027
if (cfg == undefined)
2020-
return undefined;
2028+
return {};
20212029

2022-
const extraArgs: string[] = [];
2030+
const extraArgs: { [expr: string]: string | undefined } = {};
2031+
2032+
this._matchExtraArgsForFolder(folderpath, isVirtpath, cfg, (expr, path, val) => {
2033+
2034+
if (val) {
2035+
if (extraArgs[expr]) {
2036+
extraArgs[expr] = extraArgs[expr] + ' ' + val;
2037+
} else {
2038+
extraArgs[expr] = val;
2039+
}
2040+
}
20232041

2024-
this._matchExtraArgsForFolder(folderpath, isVirtpath, cfg, (expr, path, args) => {
2025-
extraArgs.push(args);
20262042
return false;
20272043
});
20282044

2029-
return extraArgs.length > 0 ? extraArgs : undefined;
2045+
return extraArgs;
20302046
}
20312047

20322048
private _matchExtraArgsForFolder(
@@ -2611,7 +2627,18 @@ class EIDEProject extends AbstractProject {
26112627
}
26122628

26132629
private getExtraCompilerOptionsBySrcFile(srcPath: string, vPath?: string): string[] | undefined {
2614-
return this.getExtraArgsForSource(srcPath, vPath, this.getSourceExtraArgsCfg());
2630+
2631+
const allArgs = this.getExtraArgsForSource(srcPath, vPath, this.getSourceExtraArgsCfg());
2632+
if (!allArgs)
2633+
return undefined;
2634+
2635+
const argsList: string[] = [];
2636+
2637+
for (const expr in allArgs) {
2638+
argsList.push(allArgs[expr] || '');
2639+
}
2640+
2641+
return argsList;
26152642
}
26162643

26172644
//////////////////////////////// source refs ///////////////////////////////////

src/EIDEProjectExplorer.ts

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4788,41 +4788,51 @@ export class ProjectExplorer implements CustomConfigurationProvider {
47884788
if (!extraArgs)
47894789
return;
47904790

4791-
const ccArgs = project.getExtraArgsForSource(fspath, virtpath, extraArgs)?.join(' ').trim() || '';
4791+
const argsMap = project.getExtraArgsForSource(fspath, virtpath, extraArgs);
47924792
const absPattern = project.getExtraArgsAbsPatternForSource(fspath, virtpath, extraArgs);
4793-
const isInherited = ccArgs && !absPattern;
4793+
const ccOptions = absPattern ? (argsMap[absPattern] || '') : '';
4794+
4795+
// merge all inherited args
4796+
let inheritedArgs: string = '';
4797+
for (const key in argsMap) {
4798+
const val = argsMap[key]?.trim();
4799+
if (key != absPattern && val) {
4800+
inheritedArgs = `${inheritedArgs} ${val}`;
4801+
}
4802+
}
4803+
inheritedArgs = inheritedArgs.trim();
47944804

47954805
const ui_cfg: SimpleUIConfig = {
4796-
title: 'Extra Compiler Args',
4806+
title: 'Extra Compiler Options',
47974807
items: {},
47984808
};
47994809

4800-
if (isInherited) { // 继承于其他匹配模式
4810+
if (inheritedArgs) { // 继承于其他匹配模式
48014811
ui_cfg.items['inherit'] = {
48024812
type: 'input',
48034813
attrs: { readonly: true },
4804-
name: `Inherited Args (from other args pattern, check your '*.files.options.yml' file for details !)`,
4814+
name: `Inherited Options (from other pattern, check your '*.files.options.yml' file for details !)`,
48054815
data: <SimpleUIConfigData_input>{
4806-
value: ccArgs,
4807-
default: ccArgs
4816+
value: inheritedArgs,
4817+
default: inheritedArgs
48084818
}
48094819
};
48104820
}
48114821

48124822
ui_cfg.items['args'] = {
48134823
type: 'input',
48144824
attrs: {},
4815-
name: 'Compiler Args',
4825+
name: 'Compiler Options',
48164826
data: <SimpleUIConfigData_input>{
48174827
placeHolder: `compiler options, like: '-O1', '-Os', '-flto' ...`,
4818-
value: isInherited ? '' : ccArgs,
4819-
default: isInherited ? '' : ccArgs,
4828+
value: ccOptions,
4829+
default: ccOptions,
48204830
},
48214831
};
48224832

48234833
WebPanelManager.instance().showSimpleConfigUI(ui_cfg, (new_cfg) => {
48244834

4825-
const nArgs = (<SimpleUIConfigData_input>new_cfg.items['args'].data).value.trim();
4835+
const nArgs = (<SimpleUIConfigData_input>new_cfg.items['args'].data).value.replace(/\r\n|\n/g, ' ').trim();
48264836

48274837
let pattern: string;
48284838

@@ -4884,35 +4894,45 @@ export class ProjectExplorer implements CustomConfigurationProvider {
48844894
if (!extraArgs)
48854895
return;
48864896

4887-
const ccArgs = project.getExtraArgsForFolder(folderpath, isVirtpath, extraArgs)?.join(' ').trim() || '';
4897+
const argsMap = project.getExtraArgsForFolder(folderpath, isVirtpath, extraArgs);
48884898
const absPattern = project.getExtraArgsAbsPatternForFolder(folderpath, isVirtpath, extraArgs);
4889-
const isInherited = ccArgs && !absPattern;
4899+
const ccOptions = absPattern ? (argsMap[absPattern] || '') : '';
4900+
4901+
// merge all inherited args
4902+
let inheritedOptions: string = '';
4903+
for (const key in argsMap) {
4904+
const val = argsMap[key]?.trim();
4905+
if (key != absPattern && val) {
4906+
inheritedOptions = `${inheritedOptions} ${val}`;
4907+
}
4908+
}
4909+
inheritedOptions = inheritedOptions.trim();
48904910

48914911
const ui_cfg: SimpleUIConfig = {
4892-
title: 'Extra Compiler Args',
4912+
title: 'Extra Compiler Options',
48934913
items: {},
48944914
};
48954915

4896-
if (isInherited) { // 继承于其他匹配模式
4916+
if (inheritedOptions) { // 继承于其他匹配模式
48974917
ui_cfg.items['inherit'] = {
48984918
type: 'input',
48994919
attrs: { readonly: true },
4900-
name: `Inherited Args (from other args pattern, check your '*.files.options.yml' file for details !)`,
4920+
name: `Inherited Options (from other args pattern, check your '*.files.options.yml' file for details !)`,
49014921
data: <SimpleUIConfigData_input>{
4902-
value: ccArgs,
4903-
default: ccArgs
4922+
value: inheritedOptions,
4923+
default: inheritedOptions
49044924
}
49054925
};
49064926
}
49074927

49084928
ui_cfg.items['args'] = {
49094929
type: 'input',
49104930
attrs: {},
4911-
name: 'Compiler Args',
4931+
name: 'Compiler Options',
49124932
data: <SimpleUIConfigData_input>{
49134933
placeHolder: `compiler options, like: '-O1', '-Os', '-flto' ...`,
4914-
value: isInherited ? '' : ccArgs,
4915-
default: isInherited ? '' : ccArgs,
4934+
value: ccOptions,
4935+
default: ccOptions,
49164936
},
49174937
};
49184938

@@ -4930,7 +4950,7 @@ export class ProjectExplorer implements CustomConfigurationProvider {
49304950

49314951
WebPanelManager.instance().showSimpleConfigUI(ui_cfg, (new_cfg) => {
49324952

4933-
const nArgs = (<SimpleUIConfigData_input>new_cfg.items['args'].data).value.trim();
4953+
const nArgs = (<SimpleUIConfigData_input>new_cfg.items['args'].data).value.replace(/\r\n|\n/g, ' ').trim();
49344954
const isRecursive = (<SimpleUIConfigData_boolean>new_cfg.items['recursive'].data).value;
49354955

49364956
let pattern: string;

src/ToolchainManager.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,6 @@ class SDCC implements IToolchian {
829829
afterBuildTasks: [],
830830
global: {
831831
"device": "mcs51",
832-
"$one-module-per-function": false,
833832
"optimize-type": "speed",
834833
"use-non-free": false
835834
},

0 commit comments

Comments
 (0)