From be89778b3bc256c070946d997a9f6a96163ff615 Mon Sep 17 00:00:00 2001 From: WebFreak001 Date: Thu, 4 Feb 2016 16:00:17 +0100 Subject: [PATCH] Made pausing the program possible! :tada: --- README.md | 8 +++++--- src/backend/mi2/mi2.ts | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bb62641..13131c7 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,11 @@ Now you need to change `target` to the application you want to debug relative to the cwd. (Which is the workspace root by default) Before debugging you need to compile your application first, then you can run it using -the green start button in the debug sidebar. Multithreading and adding breakpoints -while running does not work at the time of writing. However you can add/remove breakpoints -as you wish while the program is paused. +the green start button in the debug sidebar. For this you could use the `preLaunchTask` +argument vscode allows you to do. Debugging multithreaded applications is currently not +implemented. Adding breakpoints while the program runs will not interrupt it immediately. +For that you need to pause & resume the program once first. However adding breakpoints +while its paused works as expected. Extending variables is very limited as it does not support child values of variables. Watching expressions works partially but the result does not get properly parsed and diff --git a/src/backend/mi2/mi2.ts b/src/backend/mi2/mi2.ts index 97e7585..b13fcf1 100644 --- a/src/backend/mi2/mi2.ts +++ b/src/backend/mi2/mi2.ts @@ -15,6 +15,7 @@ export class MI2 extends EventEmitter implements IBackend { this.process.stderr.on("data", this.stdout.bind(this)); this.process.on("exit", (() => { this.emit("quit"); }).bind(this)); Promise.all([ + this.sendCommand("gdb-set target-async on"), this.sendCommand("environment-directory \"" + cwd + "\"") ]).then(resolve, reject); }); @@ -31,6 +32,7 @@ export class MI2 extends EventEmitter implements IBackend { this.process.stderr.on("data", this.stdout.bind(this)); this.process.on("exit", (() => { this.emit("quit"); }).bind(this)); Promise.all([ + this.sendCommand("gdb-set target-async on"), this.sendCommand("environment-directory \"" + cwd + "\"") ]).then(resolve, reject); }); @@ -48,6 +50,7 @@ export class MI2 extends EventEmitter implements IBackend { this.process.stderr.on("data", this.stdout.bind(this)); this.process.on("exit", (() => { this.emit("quit"); }).bind(this)); Promise.all([ + this.sendCommand("gdb-set target-async on"), this.sendCommand("environment-directory \"" + cwd + "\""), this.sendCommand("target-select remote " + target) ]).then(resolve, reject);