Skip to content

Commit 5e510e5

Browse files
authored
Merge pull request #226 from github0null/dev
v3.11.2 update
2 parents 2760834 + 4f8a957 commit 5e510e5

15 files changed

Lines changed: 154 additions & 172 deletions

CHANGELOG.md

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

77
***
88

9+
### [v3.11.2] update
10+
11+
**New**:
12+
- `Disassembly View`: Add 'Visualize Jumps' for disassembly code, [more informations](https://interrupt.memfault.com/blog/gnu-binutils#new-feature-visualize-jumps)
13+
- `Language Mode`: Add a setting `EIDE.DisplayLanguage` to choose a language for UI, prompts.
14+
15+
**Fix**:
16+
- `Memory Layout View`: Error format when user input an integer number.
17+
18+
**Optimize**:
19+
- `Utility Tools`: Use `start` command to install win32 driver.
20+
- `Promblem Matcher`: Match compiler errors in linker logs.
21+
22+
***
23+
924
### [v3.11.1] update
1025

1126
**New**:

package.json

Lines changed: 17 additions & 66 deletions
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.1",
38+
"version": "3.11.2",
3939
"preview": false,
4040
"engines": {
4141
"vscode": "^1.67.0"
@@ -180,6 +180,22 @@
180180
{
181181
"title": "Embedded IDE",
182182
"properties": {
183+
"EIDE.DisplayLanguage": {
184+
"type": "string",
185+
"scope": "resource",
186+
"markdownDescription": "Choose language type for UI, prompt strings",
187+
"default": "auto",
188+
"enum": [
189+
"auto",
190+
"en-us",
191+
"zh-cn"
192+
],
193+
"enumDescriptions": [
194+
"Auto select",
195+
"English",
196+
"Chinese"
197+
]
198+
},
183199
"EIDE.ExternalTools.IndexUrl": {
184200
"type": "string",
185201
"scope": "machine",
@@ -311,71 +327,6 @@
311327
"markdownDescription": "%settings.cmsispack.repo.url%",
312328
"default": "github0null/eide-cmsis-pack/contents/packages"
313329
},
314-
"EIDE.SerialPortMonitor.DefaultPort": {
315-
"type": "string",
316-
"scope": "resource",
317-
"markdownDescription": "%settings.serial.def.port%"
318-
},
319-
"EIDE.SerialPortMonitor.ShowStatusBar": {
320-
"type": "boolean",
321-
"scope": "resource",
322-
"markdownDescription": "%settings.serial.show.toolbar%",
323-
"default": true
324-
},
325-
"EIDE.SerialPortMonitor.useUnixLF": {
326-
"type": "boolean",
327-
"scope": "resource",
328-
"markdownDescription": "%settings.serial.use.unix.lf%",
329-
"default": false
330-
},
331-
"EIDE.SerialPortMonitor.BaudRate": {
332-
"type": "integer",
333-
"scope": "resource",
334-
"markdownDescription": "%settings.serial.baud%",
335-
"default": 115200
336-
},
337-
"EIDE.SerialPortMonitor.DataBits": {
338-
"type": "integer",
339-
"scope": "resource",
340-
"markdownDescription": "%settings.serial.data.width%",
341-
"default": 8
342-
},
343-
"EIDE.SerialPortMonitor.Parity": {
344-
"type": "integer",
345-
"scope": "resource",
346-
"markdownDescription": "%settings.serial.parity%",
347-
"default": 0,
348-
"enum": [
349-
0,
350-
1,
351-
2,
352-
3,
353-
4
354-
],
355-
"enumDescriptions": [
356-
"None",
357-
"Odd",
358-
"Even",
359-
"Mark",
360-
"Space"
361-
]
362-
},
363-
"EIDE.SerialPortMonitor.StopBits": {
364-
"type": "integer",
365-
"scope": "resource",
366-
"markdownDescription": "%settings.serial.stop.bits%",
367-
"default": 1,
368-
"enum": [
369-
1,
370-
2,
371-
3
372-
],
373-
"enumDescriptions": [
374-
"One",
375-
"Two",
376-
"OnePointFive"
377-
]
378-
},
379330
"EIDE.IAR.STM8.InstallDirectory": {
380331
"type": "string",
381332
"scope": "resource",

package.nls.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"eide.project.run.cppcheck": "Cppcheck Project",
7777
"eide.project.clear.cppcheck": "Clear Cppcheck Diagnostic Informations",
7878

79-
"eide.package.install": "Install Chip Support Package",
79+
"eide.package.install": "Install CMSIS Chip Package",
8080
"eide.package.install.cmsis": "Install CMSIS Header Files",
8181
"eide.package.remove": "Uninstall Chip Support Package",
8282
"eide.package.select.device": "Choose Device",
@@ -161,5 +161,5 @@
161161
"string.eide.open_docs": "Learn More",
162162
"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/)",
163163

164-
"string.eide.project.welcome": "There are 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)"
164+
"string.eide.project.welcome": "There are no projects in this workspace !\n[New Project](command:eide.operation.new_project)\n[Open Project](command:eide.operation.open_project)\n[Import Project](command:eide.operation.import_project)"
165165
}

package.nls.zh-CN.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"eide.project.run.cppcheck": "使用 Cppcheck 检查项目",
7070
"eide.project.clear.cppcheck": "清除 Cppcheck 诊断信息",
7171

72-
"eide.package.install": "安装芯片支持包",
72+
"eide.package.install": "安装 CMSIS 芯片支持包",
7373
"eide.package.install.cmsis": "安装 CMSIS 头文件",
7474
"eide.package.remove": "卸载芯片支持包",
7575
"eide.package.select.device": "选择芯片",
@@ -154,5 +154,5 @@
154154
"string.eide.open_docs": "了解更多",
155155
"string.eide.open_docs.detail": "点击链接可以打开主页,也许能帮您了解到更多的用法。\n[Embedded IDE](https://em-ide.com/)",
156156

157-
"string.eide.project.welcome": "该工作区中没有任何项目!\n[打开项目](command:eide.operation.open_project)\n[新建项目](command:eide.operation.new_project)\n[导入项目](command:eide.operation.import_project)"
157+
"string.eide.project.welcome": "该工作区中没有任何项目!\n[新建项目](command:eide.operation.new_project)\n[打开项目](command:eide.operation.open_project)\n[导入项目](command:eide.operation.import_project)"
158158
}

res/html/mem_layout_view/js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/EIDEProjectExplorer.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ import {
8888
genGithubHash, md5, toArray, newMarkdownString, newFileTooltipString, FileTooltipInfo, escapeXml,
8989
readGithubRepoTxtFile, downloadFile, notifyReloadWindow, formatPath, execInternalCommand,
9090
copyAndMakeObjectKeysToLowerCase,
91-
sortPaths
91+
sortPaths,
92+
getGccBinutilsVersion,
93+
compareVersion
9294
} from './utility';
9395
import { concatSystemEnvPath, DeleteDir, exeSuffix, kill, osType, DeleteAllChildren } from './Platform';
9496
import { KeilARMOption, KeilC51Option, KeilParser, KeilRteDependence } from './KeilXmlParser';
@@ -5010,6 +5012,11 @@ export class ProjectExplorer implements CustomConfigurationProvider {
50105012
exeFile = File.fromArray([prj.getToolchain().getToolchainDir().path, 'bin', `${toolPrefix}objdump${exeSuffix()}`]);
50115013
if (!exeFile.IsFile()) { throw Error(`Not found '${exeFile.name}' !`) }
50125014
cmds = ['-S', '-l', elfPath, '>', dasmFile.path];
5015+
// https://interrupt.memfault.com/blog/gnu-binutils#new-feature-visualize-jumps
5016+
const binutilsVer = getGccBinutilsVersion(exeFile.dir, toolPrefix, 'objdump');
5017+
if (binutilsVer && compareVersion(binutilsVer, '2.34') > 0) {
5018+
cmds = ['--visualize-jumps'].concat(cmds);
5019+
}
50135020
}
50145021
else if (toolchainName.startsWith('AC')) { // armcc
50155022
exeFile = File.fromArray([prj.getToolchain().getToolchainDir().path, 'bin', `fromelf${exeSuffix()}`]);
@@ -5124,6 +5131,11 @@ export class ProjectExplorer implements CustomConfigurationProvider {
51245131
exeFile = File.fromArray([activePrj.getToolchain().getToolchainDir().path, 'bin', `${toolPrefix}objdump${exeSuffix()}`]);
51255132
if (!exeFile.IsFile()) { throw Error(`Not found '${exeFile.name}' !`) }
51265133
cmds = ['-S', '-l', objPath, '>', tmpFile.path];
5134+
// https://interrupt.memfault.com/blog/gnu-binutils#new-feature-visualize-jumps
5135+
const binutilsVer = getGccBinutilsVersion(exeFile.dir, toolPrefix, 'objdump');
5136+
if (binutilsVer && compareVersion(binutilsVer, '2.34') > 0) {
5137+
cmds = ['--visualize-jumps'].concat(cmds);
5138+
}
51275139
}
51285140
else if (toolchainName.startsWith('AC')) { // armcc
51295141
exeFile = File.fromArray([activePrj.getToolchain().getToolchainDir().path, 'bin', `fromelf${exeSuffix()}`]);

src/EIDEProjectModules.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,14 @@ export abstract class ArmBaseCompileConfigModel
672672
this._event.emit('dataChanged');
673673
}
674674

675+
private parseIntNumber(str: string): number {
676+
if (/^\s*0x/i.test(str) || /[a-f]/i.test(str)) {
677+
return parseInt(str.replace('0X', ''), 16);
678+
} else {
679+
return parseInt(str);
680+
}
681+
}
682+
675683
private sortStorage(storageLayout: ARMStorageLayout): ARMStorageLayout {
676684

677685
storageLayout.RAM = storageLayout.RAM.sort((a, b): number => {
@@ -688,7 +696,7 @@ export abstract class ArmBaseCompileConfigModel
688696
return a.id - b.id;
689697
}
690698

691-
return parseInt(a.mem.startAddr, 16) < parseInt(b.mem.startAddr, 16) ? -1 : 1;
699+
return this.parseIntNumber(a.mem.startAddr) < this.parseIntNumber(b.mem.startAddr) ? -1 : 1;
692700
});
693701

694702
let id = 1;
@@ -712,7 +720,7 @@ export abstract class ArmBaseCompileConfigModel
712720
return a.id - b.id;
713721
}
714722

715-
return parseInt(a.mem.startAddr, 16) < parseInt(b.mem.startAddr, 16) ? -1 : 1;
723+
return this.parseIntNumber(a.mem.startAddr) < this.parseIntNumber(b.mem.startAddr) ? -1 : 1;
716724
});
717725

718726
id = 1;

src/KeilXmlParser.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,11 @@ class ARMParser extends KeilParser<KeilARMOption> {
778778
}
779779

780780
// default startUp index: 3 (2^3)
781-
const index = Math.log2(parseInt(info.StupSel));
781+
let index = Math.log2(parseInt(info.StupSel) || 1);
782+
if (index > 4) {
783+
index = 4;
784+
}
785+
782786
memInfo.ROM[index].isStartup = true;
783787

784788
memInfo.RAM[0].noInit = info.NoZi1 !== '0';

src/OperationExplorer.ts

Lines changed: 10 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -211,25 +211,25 @@ export class OperationExplorer {
211211
iconPath: vscode.Uri.file(icoPath.path)
212212
});
213213

214-
icoPath = resManager.GetIconByName('Import_16x.svg');
214+
icoPath = resManager.GetIconByName('OpenFileFromProject_16x.svg');
215215
this.provider.AddData({
216-
label: view_str$import_project,
216+
label: open_project,
217217
command: {
218-
title: view_str$import_project,
219-
command: '_cl.eide.Operation.Import'
218+
title: open_project,
219+
command: '_cl.eide.Operation.Open'
220220
},
221-
tooltip: import_project_hit,
221+
tooltip: open_project_hit,
222222
iconPath: vscode.Uri.file(icoPath.path)
223223
});
224224

225-
icoPath = resManager.GetIconByName('OpenFileFromProject_16x.svg');
225+
icoPath = resManager.GetIconByName('Import_16x.svg');
226226
this.provider.AddData({
227-
label: open_project,
227+
label: view_str$import_project,
228228
command: {
229-
title: open_project,
230-
command: '_cl.eide.Operation.Open'
229+
title: view_str$import_project,
230+
command: '_cl.eide.Operation.Import'
231231
},
232-
tooltip: open_project_hit,
232+
tooltip: import_project_hit,
233233
iconPath: vscode.Uri.file(icoPath.path)
234234
});
235235

@@ -1541,54 +1541,6 @@ export class OperationExplorer {
15411541

15421542
this.locked = false;
15431543
}
1544-
1545-
async onOpenSerialPortMonitor(port?: string) {
1546-
1547-
const resManager = ResManager.GetInstance();
1548-
const option = SettingManager.GetInstance().getPortSerialMonitorOptions();
1549-
1550-
try {
1551-
const portName: string | undefined = port || option.defaultPort;
1552-
if (!portName) {
1553-
return;
1554-
}
1555-
1556-
const paramList: string[] = [
1557-
'-n', portName,
1558-
'-b', option.baudRate.toString(),
1559-
'-d', option.dataBits.toString(),
1560-
'-p', option.parity.toString(),
1561-
'-s', option.stopBits.toString(),
1562-
'-l', option.useUnixCRLF ? '1' : '0'
1563-
];
1564-
1565-
let terminal: vscode.Terminal;
1566-
const terminalName = portName;
1567-
1568-
const cIndex = vscode.window.terminals.findIndex((term) => { return term.name === terminalName; });
1569-
const cmdPath = resManager.getCMDPath();
1570-
1571-
// close exist terminal
1572-
if (cIndex !== -1) { vscode.window.terminals[cIndex].dispose(); }
1573-
1574-
const opts: vscode.TerminalOptions = {
1575-
name: terminalName,
1576-
shellPath: cmdPath,
1577-
env: process.env
1578-
};
1579-
1580-
terminal = vscode.window.createTerminal(opts);
1581-
terminal.show(true);
1582-
1583-
/* send command */
1584-
const exeName = resManager.getSerialPortExe().noSuffixName;
1585-
const cmd = paramList.join(' ');
1586-
terminal.sendText(`${exeName} ${cmd}`);
1587-
1588-
} catch (error) {
1589-
GlobalEvent.emit('error', error);
1590-
}
1591-
}
15921544
}
15931545

15941546
interface UtilToolPickItem extends vscode.QuickPickItem {

src/ProblemMatcher.ts

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,53 @@ function parseLogLines(file: File): string[] {
1818

1919
try {
2020

21+
const fileLines = file.Read().split(/\r\n|\n/);
22+
23+
//
24+
// cc logs
25+
//
2126
let logStarted = false;
2227
let logEnd = false;
2328

24-
file.Read().split(/\r\n|\n/).forEach((line, idx) => {
29+
fileLines.forEach((line, idx) => {
2530

2631
if (logEnd)
2732
return;
2833

29-
if (logStarted) {
34+
if (!logStarted) {
35+
if (line.startsWith('>>> cc')) {
36+
logStarted = true;
37+
}
38+
} else {
3039
if (line.startsWith('>>>')) {
3140
logEnd = true;
3241
} else {
3342
ccLogLines.push(line);
3443
}
35-
} else {
36-
if (line.startsWith('>>> cc')) {
44+
}
45+
});
46+
47+
//
48+
// ld logs
49+
//
50+
logStarted = false;
51+
logEnd = false;
52+
53+
fileLines.forEach((line, idx) => {
54+
55+
if (logEnd)
56+
return;
57+
58+
if (!logStarted) {
59+
if (line.startsWith('>>> ld')) {
3760
logStarted = true;
3861
}
62+
} else {
63+
if (line.startsWith('>>>')) {
64+
logEnd = true;
65+
} else {
66+
ccLogLines.push(line);
67+
}
3968
}
4069
});
4170

0 commit comments

Comments
 (0)