File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -478,6 +478,19 @@ export class MI2 extends EventEmitter implements IBackend {
478478 } ) ;
479479 }
480480
481+ goto ( filename : string , line : number ) : Thenable < Boolean > {
482+ if ( trace )
483+ this . log ( "stderr" , "goto" ) ;
484+ return new Promise ( ( resolve , reject ) => {
485+ const target : string = ( filename ? filename + ":" : "" ) + line ;
486+ this . sendCommand ( "break-insert -t " + target ) . then ( ( ) => {
487+ this . sendCommand ( "exec-jump " + target ) . then ( ( info ) => {
488+ resolve ( info . resultRecords . resultClass == "running" ) ;
489+ } , reject ) ;
490+ } , reject ) ;
491+ } ) ;
492+ }
493+
481494 changeVariable ( name : string , rawValue : string ) : Thenable < any > {
482495 if ( trace )
483496 this . log ( "stderr" , "changeVariable" ) ;
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ export interface AttachRequestArguments extends DebugProtocol.AttachRequestArgum
3636
3737class GDBDebugSession extends MI2DebugSession {
3838 protected initializeRequest ( response : DebugProtocol . InitializeResponse , args : DebugProtocol . InitializeRequestArguments ) : void {
39+ response . body . supportsGotoTargetsRequest = true ;
3940 response . body . supportsHitConditionalBreakpoints = true ;
4041 response . body . supportsConfigurationDoneRequest = true ;
4142 response . body . supportsConditionalBreakpoints = true ;
Original file line number Diff line number Diff line change @@ -653,6 +653,27 @@ export class MI2DebugSession extends DebugSession {
653653 } ) ;
654654 }
655655 }
656+
657+ protected gotoTargetsRequest ( response : DebugProtocol . GotoTargetsResponse , args : DebugProtocol . GotoTargetsArguments ) : void {
658+ this . miDebugger . goto ( args . source . path , args . line ) . then ( done => {
659+ response . body = {
660+ targets : [ {
661+ id : 1 ,
662+ label : args . source . name ,
663+ column : args . column ,
664+ line : args . line
665+ } ]
666+ } ;
667+ this . sendResponse ( response ) ;
668+ } , msg => {
669+ this . sendErrorResponse ( response , 6 , `Could not step over: ${ msg } ` ) ;
670+ } ) ;
671+ }
672+
673+ protected gotoRequest ( response : DebugProtocol . GotoResponse , args : DebugProtocol . GotoArguments ) : void {
674+ this . sendResponse ( response ) ;
675+ }
676+
656677}
657678
658679function prettyStringArray ( strings ) {
You can’t perform that action at this time.
0 commit comments