@@ -124,11 +124,20 @@ private void LaunchInGdbDebugger(string file)
124
124
{
125
125
writer . WriteAttributeString ( "WorkingDirectory" , EscapePath ( debugConfig . WorkingDir ) ) ;
126
126
// GDB won't search working directory by default, but this is expected on Windows.
127
- writer . WriteAttributeString ( "AdditionalSOLibSearchPath" , debugConfig . WorkingDir ) ;
127
+ string rustBinPath = RustBinPath ( ) ;
128
+ string additionalPath ;
129
+ if ( rustBinPath != null )
130
+ additionalPath = rustBinPath + ";" + debugConfig . WorkingDir ;
131
+ else
132
+ additionalPath = debugConfig . WorkingDir ;
133
+ writer . WriteAttributeString ( "AdditionalSOLibSearchPath" , additionalPath ) ;
128
134
}
129
135
else
130
136
{
131
137
writer . WriteAttributeString ( "WorkingDirectory" , EscapePath ( Path . GetDirectoryName ( file ) ) ) ;
138
+ string rustBinPath = RustBinPath ( ) ;
139
+ if ( rustBinPath != null )
140
+ writer . WriteAttributeString ( "AdditionalSOLibSearchPath" , rustBinPath ) ;
132
141
}
133
142
// this affects the number of bytes the engine reads when disassembling commands,
134
143
// x64 has the largest maximum command size, so it should be safe to use for x86 as well
@@ -243,21 +252,26 @@ private ProcessStartInfo CreateProcessStartInfo(string startupFile)
243
252
return startInfo ;
244
253
}
245
254
246
- private void InjectRustBinPath ( ProcessStartInfo startInfo )
255
+ private string RustBinPath ( )
247
256
{
248
257
EnvDTE . Project proj = project . GetAutomationObject ( ) as EnvDTE . Project ;
249
- if ( proj == null )
250
- return ;
258
+ if ( proj == null )
259
+ return null ;
251
260
string currentConfigName = Utilities . GetActiveConfigurationName ( proj ) ;
252
- if ( currentConfigName == null )
253
- return ;
254
- ProjectConfig currentConfig = project . ConfigProvider . GetProjectConfiguration ( currentConfigName ) ;
255
- if ( currentConfig == null )
256
- return ;
261
+ if ( currentConfigName == null )
262
+ return null ;
263
+ ProjectConfig currentConfig = project . ConfigProvider . GetProjectConfiguration ( currentConfigName ) ;
264
+ if ( currentConfig == null )
265
+ return null ;
257
266
string currentTarget = currentConfig . GetConfigurationProperty ( "PlatformTarget" , true ) ;
258
- if ( currentTarget == null )
259
- currentTarget = Shared . Environment . DefaultTarget ;
260
- string installPath = Shared . Environment . FindInstallPath ( currentTarget ) ;
267
+ if ( currentTarget == null )
268
+ currentTarget = Shared . Environment . DefaultTarget ;
269
+ return Shared . Environment . FindInstallPath ( currentTarget ) ;
270
+ }
271
+
272
+ private void InjectRustBinPath ( ProcessStartInfo startInfo )
273
+ {
274
+ string installPath = RustBinPath ( ) ;
261
275
if ( installPath == null )
262
276
return ;
263
277
string envPath = Environment . GetEnvironmentVariable ( "PATH" ) ;
0 commit comments