From 691212b1a7ce815b48b723b182c410dad2299154 Mon Sep 17 00:00:00 2001 From: xuhong Date: Tue, 26 Dec 2023 10:11:26 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E5=A4=8D=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=81=87=E5=88=B0=E4=B8=AD=E6=8B=AC=E5=8F=B7?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E5=A4=B1=E8=B4=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ package.json | 2 +- src/backend/mi2/mi2.ts | 17 ++++++++++++----- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb5d7da..00f3ca8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.2.1 +- add log message function; +- solve the problem of parsing two-dimensional arrays failure; # 0.2.0 - support qt variable; - fix the problem of step out fail from main(); diff --git a/package.json b/package.json index 346818a..63c3ebc 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "debug" ], "license": "public domain", - "version": "0.2.0", + "version": "0.2.1", "publisher": "KylinIDETeam", "icon": "images/native-debug.png", "engines": { diff --git a/src/backend/mi2/mi2.ts b/src/backend/mi2/mi2.ts index 554dd8f..e810d10 100644 --- a/src/backend/mi2/mi2.ts +++ b/src/backend/mi2/mi2.ts @@ -81,7 +81,9 @@ export class MI2 extends EventEmitter implements IBackend { protected logMsg: Breakpoint[] = []; protected logMsgNum = 0; protected logMsgVar = ""; + protected logMsgVarProcess = ""; protected logMsgRplNum = 0; + protected logMsgRplItem: string[] = []; load(cwd: string, target: string, procArgs: string, separateConsole: string): Thenable { if (!path.isAbsolute(target)) target = path.join(cwd, target); @@ -394,12 +396,15 @@ export class MI2 extends EventEmitter implements IBackend { let content = record.content; const variableMatch = logMsgMatch.exec(content) let value = content.substr(variableMatch[1].length).trim(); - - const result = this.logMsgVar.replace(logReplace, value); + this.logMsgRplItem.push(value); + // const result = this.logMsgVar.replace(logReplace, value); + // this.logMsgVar = result; this.logMsgRplNum--; - this.logMsgVar = result; if(this.logMsgRplNum == 0){ - this.log("console", "Log Message:" + this.logMsgVar); + for(let i=0; i App6: +++++++++:" + this.logMsgNum + ":" + record.content + ":" + this.logMsgVar); @@ -451,6 +456,8 @@ export class MI2 extends EventEmitter implements IBackend { const matches = this.logMsgVar.match(logReplaceTest); const count = matches ? matches.length : 0; this.logMsgRplNum = count; + this.logMsgVarProcess = this.logMsgVar.replace(logReplaceTest, "placeholderxxvvxx"); + this.logMsgRplItem = []; } }); break; @@ -670,7 +677,7 @@ export class MI2 extends EventEmitter implements IBackend { } setLogPoint(bkptNum, command): Thenable { - this.log("stderr", `setLogoPoint : ` + command); + // this.log("stderr", `setLogoPoint : ` + command); const regex = /{([a-z0-9A-Z-_\.\>\&\*]*)}/gm; // Alternative syntax using RegExp constructor