@@ -50,9 +50,9 @@ export class MI2 extends EventEmitter implements IBackend {
5050 }
5151 }
5252
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 ) ;
5656 return new Promise ( ( resolve , reject ) => {
5757 this . isSSH = false ;
5858 const args = this . preargs . concat ( this . extraargs || [ ] ) ;
@@ -61,7 +61,7 @@ export class MI2 extends EventEmitter implements IBackend {
6161 this . process . stderr . on ( "data" , this . stderr . bind ( this ) ) ;
6262 this . process . on ( "exit" , ( ( ) => { this . emit ( "quit" ) ; } ) . bind ( this ) ) ;
6363 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 ) ;
6565 if ( procArgs && procArgs . length )
6666 promises . push ( this . sendCommand ( "exec-arguments " + procArgs ) ) ;
6767 if ( process . platform == "win32" ) {
@@ -181,20 +181,20 @@ export class MI2 extends EventEmitter implements IBackend {
181181 } ) ;
182182 }
183183
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 ) {
185185 if ( ssh ) {
186- if ( ! path . isAbsolute ( target ) )
187- target = path . join ( cwd , target ) ;
186+ if ( ! path . isAbsolute ( executable ) )
187+ executable = path . join ( cwd , executable ) ;
188188 } else {
189- if ( ! nativePath . isAbsolute ( target ) )
190- target = nativePath . join ( cwd , target ) ;
189+ if ( ! nativePath . isAbsolute ( executable ) )
190+ executable = nativePath . join ( cwd , executable ) ;
191191 }
192192 const cmds = [
193193 this . sendCommand ( "gdb-set target-async on" , true ) ,
194194 this . sendCommand ( "environment-directory \"" + escape ( cwd ) + "\"" , true )
195195 ] ;
196196 if ( ! attach )
197- cmds . push ( this . sendCommand ( "file-exec-and-symbols \"" + escape ( target ) + "\"" ) ) ;
197+ cmds . push ( this . sendCommand ( "file-exec-and-symbols \"" + escape ( executable ) + "\"" ) ) ;
198198 if ( this . prettyPrint )
199199 cmds . push ( this . sendCommand ( "enable-pretty-printing" ) ) ;
200200
0 commit comments