Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions samples/Playground/DebuggerUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,15 @@ private static bool AttachVs(Process vs, int pid, bool enableLog = false)

if (dn.StartsWith("!VisualStudio.DTE.", StringComparison.Ordinal) && dn.EndsWith(dteSuffix, StringComparison.Ordinal))
{
object dbg, lps;
runningObjectTable.GetObject(moniker[0], out object dte);

// The COM object can be busy, we retry few times, hoping that it won't be busy next time.
for (int i = 0; i < 10; i++)
{
try
{
dbg = dte.GetType().InvokeMember("Debugger", BindingFlags.GetProperty, null, dte, null, CultureInfo.InvariantCulture)!;
lps = dbg.GetType().InvokeMember("LocalProcesses", BindingFlags.GetProperty, null, dbg, null, CultureInfo.InvariantCulture)!;
var dbg = dte.GetType().InvokeMember("Debugger", BindingFlags.GetProperty, null, dte, null, CultureInfo.InvariantCulture)!;
var lps = dbg.GetType().InvokeMember("LocalProcesses", BindingFlags.GetProperty, null, dbg, null, CultureInfo.InvariantCulture)!;
Comment thread
Evangelink marked this conversation as resolved.
Resolved
var lpn = (System.Collections.IEnumerator)lps.GetType().InvokeMember("GetEnumerator", BindingFlags.InvokeMethod, null, lps, null, CultureInfo.InvariantCulture)!;

while (lpn.MoveNext())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,9 @@ static void ProcessHigherPrecedenceOperators(
Stack<OperatorKind> operatorStack,
OperatorKind currentOp)
{
OperatorKind topStackOperator;

while (operatorStack.Count != 0 && operatorStack.Peek() > currentOp)
{
topStackOperator = operatorStack.Pop();
var topStackOperator = operatorStack.Pop();
Comment thread
SimonCropp marked this conversation as resolved.
Resolved
ProcessStackOperator(topStackOperator, expressionStack, operatorStack);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,15 @@ private static bool AttachVs(Process vs, int pid, bool enableLog = false)

if (dn.StartsWith("!VisualStudio.DTE.", StringComparison.Ordinal) && dn.EndsWith(dteSuffix, StringComparison.Ordinal))
{
object dbg, lps;
runningObjectTable.GetObject(moniker[0], out object dte);

// The COM object can be busy, we retry few times, hoping that it won't be busy next time.
for (int i = 0; i < 10; i++)
{
try
{
dbg = dte.GetType().InvokeMember("Debugger", BindingFlags.GetProperty, null, dte, null, CultureInfo.InvariantCulture)!;
lps = dbg.GetType().InvokeMember("LocalProcesses", BindingFlags.GetProperty, null, dbg, null, CultureInfo.InvariantCulture)!;
var dbg = dte.GetType().InvokeMember("Debugger", BindingFlags.GetProperty, null, dte, null, CultureInfo.InvariantCulture)!;
Comment thread
SimonCropp marked this conversation as resolved.
Resolved
var lps = dbg.GetType().InvokeMember("LocalProcesses", BindingFlags.GetProperty, null, dbg, null, CultureInfo.InvariantCulture)!;
Comment thread
SimonCropp marked this conversation as resolved.
Resolved
var lpn = (System.Collections.IEnumerator)lps.GetType().InvokeMember("GetEnumerator", BindingFlags.InvokeMethod, null, lps, null, CultureInfo.InvariantCulture)!;

while (lpn.MoveNext())
Expand Down