Skip to content

Commit

Permalink
Added postLaunchCommands launch property
Browse files Browse the repository at this point in the history
These commands will be executed after the main launch/attach sequence.
  • Loading branch information
Marus committed Jan 30, 2018
1 parent 3f814c9 commit 28e172c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
20 changes: 16 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,15 @@
},
"debuggerArgs": {
"default": [],
"description": "Additional arguments to pass to GDB",
"description": "Additional arguments to pass to GDB command line",
"type": "array"
},
},
"postLaunchCommands": {
"default": [],
"type": "array",
"items": "string",
"description": "Additional GDB Commands to be executed after the main attach sequequnce has finished. (Machine interface commands should include - prefix)."
},
"device": {
"default": "",
"description": "Target Device Identifier",
Expand Down Expand Up @@ -519,9 +525,15 @@
},
"debuggerArgs": {
"default": [],
"description": "Additional arguments to pass to GDB",
"description": "Additional arguments to pass to GDB command line",
"type": "array"
},
},
"postLaunchCommands": {
"default": [],
"type": "array",
"items": "string",
"description": "Additional GDB Commands to be executed after the main attach sequequnce has finished. (Machine interface commands should include - prefix)."
},
"device": {
"default": "",
"description": "Target Device Identifier",
Expand Down
1 change: 1 addition & 0 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export interface ConfigurationArguments extends DebugProtocol.LaunchRequestArgum
serverpath: string;
device: string;
debuggerArgs: string[];
postLaunchCommands: string[];
svdFile: string;
swoConfig: SWOConfiguration;
graphConfig: any[];
Expand Down
1 change: 1 addition & 0 deletions src/frontend/configprovider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class CortexDebugConfigurationProvider implements vscode.DebugConfigurati
});
}
if (!config.graphConfig) { config.graphConfig = []; }
if (!config.postLaunchCommands) { config.postLaunchCommands = []; }

switch (type) {
case 'jlink':
Expand Down
2 changes: 2 additions & 0 deletions src/gdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ export class GDBDebugSession extends DebugSession {

let commands = attach ? this.serverController.attachCommands() : this.serverController.launchCommands();

commands = commands.concat(this.args.postLaunchCommands.map(c => c.startsWith('-') ? c.substring(1) : `interpreter-exec console "${c}"`));

this.serverController.debuggerLaunchStarted();
this.miDebugger.connect(this.args.cwd, this.args.executable, commands).then(() => {
setTimeout(() => {
Expand Down

0 comments on commit 28e172c

Please sign in to comment.