Skip to content

Commit 5a34236

Browse files
committed
Merge pull request #151 from rkeithhill/rkeithhill/easier-debugging-of-dbghost
Easier launching of the debugging when /waitForDebugger passed in.
2 parents 2f7d0a3 + ffa44a9 commit 5a34236

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/PowerShellEditorServices.Host/Program.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ static void Main(string[] args)
2727
"/waitForDebugger",
2828
StringComparison.InvariantCultureIgnoreCase));
2929

30-
// Should we wait for the debugger before starting?
3130
if (waitForDebugger)
3231
{
33-
// Wait for 25 seconds and then continue
34-
int waitCountdown = 25;
35-
while (!Debugger.IsAttached && waitCountdown > 0)
32+
if (Debugger.IsAttached)
3633
{
37-
Thread.Sleep(1000);
38-
waitCountdown--;
34+
Debugger.Break();
35+
}
36+
else
37+
{
38+
Debugger.Launch();
3939
}
4040
}
4141
#endif

0 commit comments

Comments
 (0)