From 353be4022e489dd5cd2d9cc7c964bfc0c96a244e Mon Sep 17 00:00:00 2001 From: zhangzepeng Date: Thu, 16 Nov 2023 19:19:25 +0800 Subject: [PATCH] =?UTF-8?q?=E2=80=98fix:nativehook=E5=9C=A8=E6=8A=93?= =?UTF-8?q?=E5=8F=96=E5=8D=95=E8=BF=9B=E7=A8=8B=E6=97=B6=E4=B8=8B=E5=8F=91?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E6=98=BE=E7=A4=BApid=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangzepeng --- ide/src/trace/component/SpRecordTrace.ts | 38 +++++++++++++++++------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/ide/src/trace/component/SpRecordTrace.ts b/ide/src/trace/component/SpRecordTrace.ts index 053f5b474..e6af1aee9 100644 --- a/ide/src/trace/component/SpRecordTrace.ts +++ b/ide/src/trace/component/SpRecordTrace.ts @@ -2176,17 +2176,33 @@ export class SpRecordTrace extends BaseElement { processName = appProcess; } } - let nativeConfig: NativeHookConfig = { - saveFile: false, - fileName: '', - filterSize: this.spAllocations!.filter, - smbPages: this.spAllocations!.shared, - maxStackDepth: this.spAllocations!.unwind, - processName: processName, - stringCompressed: true, - fpUnwind: this.spAllocations!.fp_unwind, - blocked: true, - }; + let nativeConfig: NativeHookConfig; + if (this.spAllocations!.expandPids.length === 1) { + nativeConfig = { + pid: this.spAllocations!.expandPids[0], + saveFile: false, + fileName: '', + filterSize: this.spAllocations!.filter, + smbPages: this.spAllocations!.shared, + maxStackDepth: this.spAllocations!.unwind, + processName: processName, + stringCompressed: true, + fpUnwind: this.spAllocations!.fp_unwind, + blocked: true, + }; + } else { + nativeConfig = { + saveFile: false, + fileName: '', + filterSize: this.spAllocations!.filter, + smbPages: this.spAllocations!.shared, + maxStackDepth: this.spAllocations!.unwind, + processName: processName, + stringCompressed: true, + fpUnwind: this.spAllocations!.fp_unwind, + blocked: true, + }; + } let maxProcessSize = 4; if (SpRecordTrace.selectVersion !== undefined && SpRecordTrace.selectVersion !== '3.2') { nativeConfig.callframeCompress = true; -- Gitee