diff --git a/package.json b/package.json index 93dae1a3f4a1ce1f709bbb8834bedc8fda11ec06..ac3294a14d062f5267dec3611d1f2afce64f3546 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "si-debug", "displayName": "SuperIDE Debug", + "publisher": "mengning", "description": "GDB, LLDB & Mago-MI Debugger support for SuperIDE", "keywords": [ "gdb", @@ -9,7 +10,7 @@ "native", "debug" ], - "license": "public domain", + "license": "Apache-2.0", "version": "0.27.1", "author": { "name": "PlatformIO.Org" diff --git a/src/backend/mi2/mi2.ts b/src/backend/mi2/mi2.ts index 63a7e9e23c209df5d70ac98d29d6e92d4c11a0a4..30bff7a592974c77ea9fee5777f15e6d64a3c064 100644 --- a/src/backend/mi2/mi2.ts +++ b/src/backend/mi2/mi2.ts @@ -7,6 +7,7 @@ import * as net from "net"; import * as fs from "fs"; import * as path from "path"; import { Client } from "ssh2"; +import * as os from "os"; export function escape(str: string) { return str.replace(/\\/g, "\\\\").replace(/"/g, "\\\""); @@ -54,15 +55,12 @@ export class MI2 extends EventEmitter implements IBackend { return new Promise((resolve, reject) => { this.isSSH = false; const args = this.preargs.concat(this.extraargs || []); - const pythonInterpreter = '/home/denk/.superide/penv/bin/python3'; // 或者 'python',取决于你的系统和配置 - //const pythonInterpreter = 'super-ide'; // 或者 'python',取决于你的系统和配置 - // const pythonScript = ['/home/denk/.superide/penv/lib/python3.10/site-packages/superide/__main__.py', - // 'debug', '-d', '/home/denk/PlatformIO/Projects/hello', - // '--interface=gdb', '--interpreter=mi2', '-q']; - const pythonScript = ['-m','superide','debug', '-d', '/home/denk/PlatformIO/Projects/hello', + // projects_name需要从si-core或si-ide中获得 + const pythonInterpreter = '/home/'+os.userInfo().username+'/.superide/penv/bin/python3'; + const pythonScript = ['-m','superide','debug', '-d', '/home/'+os.userInfo().username+'/superide/Projects/project_name', '--interface=gdb', '--interpreter=mi2', '-q']; //this.process = ChildProcess.spawn(pythonInterpreter, pythonScript, spawnOptions1); - this.process = ChildProcess.spawn(pythonInterpreter, pythonScript, { cwd: '/home/denk/PlatformIO/Projects/hello', env: this.procEnv }); + this.process = ChildProcess.spawn(pythonInterpreter, pythonScript, { cwd: '/home/'+os.userInfo().username+'/superide/Projects/project_name', env: this.procEnv }); //this.process = ChildProcess.spawn(this.application, args, { cwd: cwd, env: this.procEnv }); this.process.stdout.on("data", this.stdout.bind(this)); this.process.stderr.on("data", this.stderr.bind(this));