Skip to content

Commit

Permalink
Merge pull request #226 from github0null/dev
Browse files Browse the repository at this point in the history
v3.11.2 update
  • Loading branch information
github0null authored Mar 19, 2023
2 parents 2760834 + 4f8a957 commit 5e510e5
Show file tree
Hide file tree
Showing 15 changed files with 154 additions and 172 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ All notable version changes will be recorded in this file.

***

### [v3.11.2] update

**New**:
- `Disassembly View`: Add 'Visualize Jumps' for disassembly code, [more informations](https://interrupt.memfault.com/blog/gnu-binutils#new-feature-visualize-jumps)
- `Language Mode`: Add a setting `EIDE.DisplayLanguage` to choose a language for UI, prompts.

**Fix**:
- `Memory Layout View`: Error format when user input an integer number.

**Optimize**:
- `Utility Tools`: Use `start` command to install win32 driver.
- `Promblem Matcher`: Match compiler errors in linker logs.

***

### [v3.11.1] update

**New**:
Expand Down
83 changes: 17 additions & 66 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"homepage": "https://em-ide.com",
"license": "MIT",
"description": "A mcu development environment for 8051/AVR/STM8/Cortex-M/RISC-V",
"version": "3.11.1",
"version": "3.11.2",
"preview": false,
"engines": {
"vscode": "^1.67.0"
Expand Down Expand Up @@ -180,6 +180,22 @@
{
"title": "Embedded IDE",
"properties": {
"EIDE.DisplayLanguage": {
"type": "string",
"scope": "resource",
"markdownDescription": "Choose language type for UI, prompt strings",
"default": "auto",
"enum": [
"auto",
"en-us",
"zh-cn"
],
"enumDescriptions": [
"Auto select",
"English",
"Chinese"
]
},
"EIDE.ExternalTools.IndexUrl": {
"type": "string",
"scope": "machine",
Expand Down Expand Up @@ -311,71 +327,6 @@
"markdownDescription": "%settings.cmsispack.repo.url%",
"default": "github0null/eide-cmsis-pack/contents/packages"
},
"EIDE.SerialPortMonitor.DefaultPort": {
"type": "string",
"scope": "resource",
"markdownDescription": "%settings.serial.def.port%"
},
"EIDE.SerialPortMonitor.ShowStatusBar": {
"type": "boolean",
"scope": "resource",
"markdownDescription": "%settings.serial.show.toolbar%",
"default": true
},
"EIDE.SerialPortMonitor.useUnixLF": {
"type": "boolean",
"scope": "resource",
"markdownDescription": "%settings.serial.use.unix.lf%",
"default": false
},
"EIDE.SerialPortMonitor.BaudRate": {
"type": "integer",
"scope": "resource",
"markdownDescription": "%settings.serial.baud%",
"default": 115200
},
"EIDE.SerialPortMonitor.DataBits": {
"type": "integer",
"scope": "resource",
"markdownDescription": "%settings.serial.data.width%",
"default": 8
},
"EIDE.SerialPortMonitor.Parity": {
"type": "integer",
"scope": "resource",
"markdownDescription": "%settings.serial.parity%",
"default": 0,
"enum": [
0,
1,
2,
3,
4
],
"enumDescriptions": [
"None",
"Odd",
"Even",
"Mark",
"Space"
]
},
"EIDE.SerialPortMonitor.StopBits": {
"type": "integer",
"scope": "resource",
"markdownDescription": "%settings.serial.stop.bits%",
"default": 1,
"enum": [
1,
2,
3
],
"enumDescriptions": [
"One",
"Two",
"OnePointFive"
]
},
"EIDE.IAR.STM8.InstallDirectory": {
"type": "string",
"scope": "resource",
Expand Down
4 changes: 2 additions & 2 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"eide.project.run.cppcheck": "Cppcheck Project",
"eide.project.clear.cppcheck": "Clear Cppcheck Diagnostic Informations",

"eide.package.install": "Install Chip Support Package",
"eide.package.install": "Install CMSIS Chip Package",
"eide.package.install.cmsis": "Install CMSIS Header Files",
"eide.package.remove": "Uninstall Chip Support Package",
"eide.package.select.device": "Choose Device",
Expand Down Expand Up @@ -161,5 +161,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": "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)"
"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)"
}
4 changes: 2 additions & 2 deletions package.nls.zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"eide.project.run.cppcheck": "使用 Cppcheck 检查项目",
"eide.project.clear.cppcheck": "清除 Cppcheck 诊断信息",

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

"string.eide.project.welcome": "该工作区中没有任何项目!\n[打开项目](command:eide.operation.open_project)\n[新建项目](command:eide.operation.new_project)\n[导入项目](command:eide.operation.import_project)"
"string.eide.project.welcome": "该工作区中没有任何项目!\n[新建项目](command:eide.operation.new_project)\n[打开项目](command:eide.operation.open_project)\n[导入项目](command:eide.operation.import_project)"
}
2 changes: 1 addition & 1 deletion res/html/mem_layout_view/js/app.js

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion src/EIDEProjectExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ import {
genGithubHash, md5, toArray, newMarkdownString, newFileTooltipString, FileTooltipInfo, escapeXml,
readGithubRepoTxtFile, downloadFile, notifyReloadWindow, formatPath, execInternalCommand,
copyAndMakeObjectKeysToLowerCase,
sortPaths
sortPaths,
getGccBinutilsVersion,
compareVersion
} from './utility';
import { concatSystemEnvPath, DeleteDir, exeSuffix, kill, osType, DeleteAllChildren } from './Platform';
import { KeilARMOption, KeilC51Option, KeilParser, KeilRteDependence } from './KeilXmlParser';
Expand Down Expand Up @@ -5010,6 +5012,11 @@ export class ProjectExplorer implements CustomConfigurationProvider {
exeFile = File.fromArray([prj.getToolchain().getToolchainDir().path, 'bin', `${toolPrefix}objdump${exeSuffix()}`]);
if (!exeFile.IsFile()) { throw Error(`Not found '${exeFile.name}' !`) }
cmds = ['-S', '-l', elfPath, '>', dasmFile.path];
// https://interrupt.memfault.com/blog/gnu-binutils#new-feature-visualize-jumps
const binutilsVer = getGccBinutilsVersion(exeFile.dir, toolPrefix, 'objdump');
if (binutilsVer && compareVersion(binutilsVer, '2.34') > 0) {
cmds = ['--visualize-jumps'].concat(cmds);
}
}
else if (toolchainName.startsWith('AC')) { // armcc
exeFile = File.fromArray([prj.getToolchain().getToolchainDir().path, 'bin', `fromelf${exeSuffix()}`]);
Expand Down Expand Up @@ -5124,6 +5131,11 @@ export class ProjectExplorer implements CustomConfigurationProvider {
exeFile = File.fromArray([activePrj.getToolchain().getToolchainDir().path, 'bin', `${toolPrefix}objdump${exeSuffix()}`]);
if (!exeFile.IsFile()) { throw Error(`Not found '${exeFile.name}' !`) }
cmds = ['-S', '-l', objPath, '>', tmpFile.path];
// https://interrupt.memfault.com/blog/gnu-binutils#new-feature-visualize-jumps
const binutilsVer = getGccBinutilsVersion(exeFile.dir, toolPrefix, 'objdump');
if (binutilsVer && compareVersion(binutilsVer, '2.34') > 0) {
cmds = ['--visualize-jumps'].concat(cmds);
}
}
else if (toolchainName.startsWith('AC')) { // armcc
exeFile = File.fromArray([activePrj.getToolchain().getToolchainDir().path, 'bin', `fromelf${exeSuffix()}`]);
Expand Down
12 changes: 10 additions & 2 deletions src/EIDEProjectModules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,14 @@ export abstract class ArmBaseCompileConfigModel
this._event.emit('dataChanged');
}

private parseIntNumber(str: string): number {
if (/^\s*0x/i.test(str) || /[a-f]/i.test(str)) {
return parseInt(str.replace('0X', ''), 16);
} else {
return parseInt(str);
}
}

private sortStorage(storageLayout: ARMStorageLayout): ARMStorageLayout {

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

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

let id = 1;
Expand All @@ -712,7 +720,7 @@ export abstract class ArmBaseCompileConfigModel
return a.id - b.id;
}

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

id = 1;
Expand Down
6 changes: 5 additions & 1 deletion src/KeilXmlParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,11 @@ class ARMParser extends KeilParser<KeilARMOption> {
}

// default startUp index: 3 (2^3)
const index = Math.log2(parseInt(info.StupSel));
let index = Math.log2(parseInt(info.StupSel) || 1);
if (index > 4) {
index = 4;
}

memInfo.ROM[index].isStartup = true;

memInfo.RAM[0].noInit = info.NoZi1 !== '0';
Expand Down
68 changes: 10 additions & 58 deletions src/OperationExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,25 +211,25 @@ export class OperationExplorer {
iconPath: vscode.Uri.file(icoPath.path)
});

icoPath = resManager.GetIconByName('Import_16x.svg');
icoPath = resManager.GetIconByName('OpenFileFromProject_16x.svg');
this.provider.AddData({
label: view_str$import_project,
label: open_project,
command: {
title: view_str$import_project,
command: '_cl.eide.Operation.Import'
title: open_project,
command: '_cl.eide.Operation.Open'
},
tooltip: import_project_hit,
tooltip: open_project_hit,
iconPath: vscode.Uri.file(icoPath.path)
});

icoPath = resManager.GetIconByName('OpenFileFromProject_16x.svg');
icoPath = resManager.GetIconByName('Import_16x.svg');
this.provider.AddData({
label: open_project,
label: view_str$import_project,
command: {
title: open_project,
command: '_cl.eide.Operation.Open'
title: view_str$import_project,
command: '_cl.eide.Operation.Import'
},
tooltip: open_project_hit,
tooltip: import_project_hit,
iconPath: vscode.Uri.file(icoPath.path)
});

Expand Down Expand Up @@ -1541,54 +1541,6 @@ export class OperationExplorer {

this.locked = false;
}

async onOpenSerialPortMonitor(port?: string) {

const resManager = ResManager.GetInstance();
const option = SettingManager.GetInstance().getPortSerialMonitorOptions();

try {
const portName: string | undefined = port || option.defaultPort;
if (!portName) {
return;
}

const paramList: string[] = [
'-n', portName,
'-b', option.baudRate.toString(),
'-d', option.dataBits.toString(),
'-p', option.parity.toString(),
'-s', option.stopBits.toString(),
'-l', option.useUnixCRLF ? '1' : '0'
];

let terminal: vscode.Terminal;
const terminalName = portName;

const cIndex = vscode.window.terminals.findIndex((term) => { return term.name === terminalName; });
const cmdPath = resManager.getCMDPath();

// close exist terminal
if (cIndex !== -1) { vscode.window.terminals[cIndex].dispose(); }

const opts: vscode.TerminalOptions = {
name: terminalName,
shellPath: cmdPath,
env: process.env
};

terminal = vscode.window.createTerminal(opts);
terminal.show(true);

/* send command */
const exeName = resManager.getSerialPortExe().noSuffixName;
const cmd = paramList.join(' ');
terminal.sendText(`${exeName} ${cmd}`);

} catch (error) {
GlobalEvent.emit('error', error);
}
}
}

interface UtilToolPickItem extends vscode.QuickPickItem {
Expand Down
37 changes: 33 additions & 4 deletions src/ProblemMatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,53 @@ function parseLogLines(file: File): string[] {

try {

const fileLines = file.Read().split(/\r\n|\n/);

//
// cc logs
//
let logStarted = false;
let logEnd = false;

file.Read().split(/\r\n|\n/).forEach((line, idx) => {
fileLines.forEach((line, idx) => {

if (logEnd)
return;

if (logStarted) {
if (!logStarted) {
if (line.startsWith('>>> cc')) {
logStarted = true;
}
} else {
if (line.startsWith('>>>')) {
logEnd = true;
} else {
ccLogLines.push(line);
}
} else {
if (line.startsWith('>>> cc')) {
}
});

//
// ld logs
//
logStarted = false;
logEnd = false;

fileLines.forEach((line, idx) => {

if (logEnd)
return;

if (!logStarted) {
if (line.startsWith('>>> ld')) {
logStarted = true;
}
} else {
if (line.startsWith('>>>')) {
logEnd = true;
} else {
ccLogLines.push(line);
}
}
});

Expand Down
Loading

0 comments on commit 5e510e5

Please sign in to comment.