Skip to content

Commit 820f79f

Browse files
jfmarquisMBulli
authored andcommitted
Add support for remote debugger
Use new IVCRulePropertyStorage interface on WindowsLocalDebugger and WindowsRemoteDebugger Rules items to get/set command line, while still using the old VCDebugSettings.CommandArguments to support legacy extensions.
1 parent a7d57e7 commit 820f79f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

SmartCmdArgs/SmartCmdArgs/Helper/ProjectArguments.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,14 @@ private static void SetVCProjEngineArguments(EnvDTE.Project project, string argu
7373
dynamic vcCfg = vcPrj.ActiveConfiguration; // is VCConfiguration
7474
dynamic vcDbg = vcCfg.DebugSettings; // is VCDebugSettings
7575

76+
// apply it first using the old way, in case the new way doesn't work for this type of projects (platforms other than Windows, for example)
7677
vcDbg.CommandArguments = arguments;
78+
79+
dynamic windowsLocalDebugger = vcCfg.Rules.Item("WindowsLocalDebugger"); // is IVCRulePropertyStorage
80+
windowsLocalDebugger.SetPropertyValue("LocalDebuggerCommandArguments", arguments);
81+
82+
dynamic windowsRemoteDebugger = vcCfg.Rules.Item("WindowsRemoteDebugger"); // is IVCRulePropertyStorage
83+
windowsRemoteDebugger.SetPropertyValue("RemoteDebuggerCommandArguments", arguments);
7784
}
7885

7986
private static void GetVCProjEngineAllArguments(EnvDTE.Project project, List<string> allArgs)
@@ -90,6 +97,20 @@ private static void GetVCProjEngineAllArguments(EnvDTE.Project project, List<str
9097
{
9198
allArgs.Add(dbg.CommandArguments);
9299
}
100+
101+
dynamic windowsLocalDebugger = cfg.Rules.Item("WindowsLocalDebugger"); // is IVCRulePropertyStorage
102+
var localArguments = windowsLocalDebugger.GetUnevaluatedPropertyValue("LocalDebuggerCommandArguments");
103+
if (!string.IsNullOrEmpty(localArguments))
104+
{
105+
allArgs.Add(localArguments);
106+
}
107+
108+
dynamic windowsRemoteDebugger = cfg.Rules.Item("WindowsRemoteDebugger"); // is IVCRulePropertyStorage
109+
var remoteArguments = windowsRemoteDebugger.GetUnevaluatedPropertyValue("RemoteDebuggerCommandArguments");
110+
if (!string.IsNullOrEmpty(remoteArguments))
111+
{
112+
allArgs.Add(remoteArguments);
113+
}
93114
}
94115
}
95116

0 commit comments

Comments
 (0)