@@ -31,6 +31,7 @@ public class DebugSession : ICDPListener, IDebuggeeListener, IRemoteControllerLi
3131 RemoteController giderosRemoteController ;
3232 string giderosStdoutBuffer = "" ;
3333 string workingDirectory ;
34+ string sourceBasePath ;
3435 Tuple < string , int > fakeBreakpointMode = null ;
3536 string startCommand ;
3637 int startSeq ;
@@ -63,7 +64,7 @@ void ICDPListener.X_FromVSCode(string command, int seq, dynamic args, string req
6364 }
6465 else if ( command == "stackTrace" )
6566 {
66- var src = new Source ( Path . Combine ( workingDirectory , fakeBreakpointMode . Item1 ) ) ;
67+ var src = new Source ( Path . Combine ( sourceBasePath , fakeBreakpointMode . Item1 ) ) ;
6768 var f = new StackFrame ( 9999 , "fake-frame" , src , fakeBreakpointMode . Item2 , 0 ) ;
6869 SendResponse ( command , seq , new StackTraceResponseBody (
6970 new List < StackFrame > ( ) { f } ) ) ;
@@ -221,7 +222,6 @@ void Launch(string command, int seq, dynamic args)
221222 }
222223
223224 //--------------------------------
224- // validate argument 'workingDirectory'
225225 if ( ! ReadBasicConfiguration ( command , seq , args ) ) { return ; }
226226
227227 //--------------------------------
@@ -374,7 +374,7 @@ bool ReadBasicConfiguration(string command, int seq, dynamic args)
374374 workingDirectory = workingDirectory . Trim ( ) ;
375375 if ( workingDirectory . Length == 0 )
376376 {
377- SendErrorResponse ( command , seq , 3003 , "Property 'cwd ' is empty." ) ;
377+ SendErrorResponse ( command , seq , 3003 , "Property 'workingDirectory ' is empty." ) ;
378378 return false ;
379379 }
380380 if ( ! Directory . Exists ( workingDirectory ) )
@@ -395,6 +395,15 @@ bool ReadBasicConfiguration(string command, int seq, dynamic args)
395395 stopGiderosWhenDebuggerStops = true ;
396396 }
397397
398+ if ( args . sourceBasePath != null )
399+ {
400+ sourceBasePath = ( string ) args . sourceBasePath ;
401+ }
402+ else
403+ {
404+ sourceBasePath = workingDirectory ;
405+ }
406+
398407 return true ;
399408 }
400409
@@ -408,7 +417,7 @@ void IDebuggeeListener.X_DebuggeeArrived(IDebuggeeSender toDebuggee)
408417 var welcome = new
409418 {
410419 command = "welcome" ,
411- sourceBasePath = workingDirectory
420+ sourceBasePath = sourceBasePath
412421 } ;
413422 toDebuggee . Send ( JsonConvert . SerializeObject ( welcome ) ) ;
414423
0 commit comments