@@ -50,9 +50,9 @@ export class MI2 extends EventEmitter implements IBackend {
50
50
}
51
51
}
52
52
53
- load ( cwd : string , target : string , procArgs : string , separateConsole : string ) : Thenable < any > {
54
- if ( ! nativePath . isAbsolute ( target ) )
55
- target = nativePath . join ( cwd , target ) ;
53
+ load ( cwd : string , executable : string , procArgs : string , separateConsole : string ) : Thenable < any > {
54
+ if ( ! nativePath . isAbsolute ( executable ) )
55
+ executable = nativePath . join ( cwd , executable ) ;
56
56
return new Promise ( ( resolve , reject ) => {
57
57
this . isSSH = false ;
58
58
const args = this . preargs . concat ( this . extraargs || [ ] ) ;
@@ -61,7 +61,7 @@ export class MI2 extends EventEmitter implements IBackend {
61
61
this . process . stderr . on ( "data" , this . stderr . bind ( this ) ) ;
62
62
this . process . on ( "exit" , ( ( ) => { this . emit ( "quit" ) ; } ) . bind ( this ) ) ;
63
63
this . process . on ( "error" , ( ( err ) => { this . emit ( "launcherror" , err ) ; } ) . bind ( this ) ) ;
64
- const promises = this . initCommands ( target , cwd ) ;
64
+ const promises = this . initCommands ( executable , cwd ) ;
65
65
if ( procArgs && procArgs . length )
66
66
promises . push ( this . sendCommand ( "exec-arguments " + procArgs ) ) ;
67
67
if ( process . platform == "win32" ) {
@@ -181,20 +181,20 @@ export class MI2 extends EventEmitter implements IBackend {
181
181
} ) ;
182
182
}
183
183
184
- protected initCommands ( target : string , cwd : string , ssh : boolean = false , attach : boolean = false ) {
184
+ protected initCommands ( executable : string , cwd : string , ssh : boolean = false , attach : boolean = false ) {
185
185
if ( ssh ) {
186
- if ( ! path . isAbsolute ( target ) )
187
- target = path . join ( cwd , target ) ;
186
+ if ( ! path . isAbsolute ( executable ) )
187
+ executable = path . join ( cwd , executable ) ;
188
188
} else {
189
- if ( ! nativePath . isAbsolute ( target ) )
190
- target = nativePath . join ( cwd , target ) ;
189
+ if ( ! nativePath . isAbsolute ( executable ) )
190
+ executable = nativePath . join ( cwd , executable ) ;
191
191
}
192
192
const cmds = [
193
193
this . sendCommand ( "gdb-set target-async on" , true ) ,
194
194
this . sendCommand ( "environment-directory \"" + escape ( cwd ) + "\"" , true )
195
195
] ;
196
196
if ( ! attach )
197
- cmds . push ( this . sendCommand ( "file-exec-and-symbols \"" + escape ( target ) + "\"" ) ) ;
197
+ cmds . push ( this . sendCommand ( "file-exec-and-symbols \"" + escape ( executable ) + "\"" ) ) ;
198
198
if ( this . prettyPrint )
199
199
cmds . push ( this . sendCommand ( "enable-pretty-printing" ) ) ;
200
200
0 commit comments