public void RunBeforeTests() { _debugger = new WinDbgWrapper(Const.PathToEngine, null); _api = new DebuggerApi(_debugger); Environment.CurrentDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "..\\..\\test-debuggees\\cpp\\src"); _debugger.ProcessExited += (a, b) => _hasExited = true; }
private void InitializeDebugger(string[] symbolsPath = null) { var options = new WinDbgOptions(Const.PathToEngine, null, symbolsPath); _debugger = new WinDbgWrapper(options); _api = new DebuggerApi(_debugger); Environment.CurrentDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "..\\..\\test-debuggees\\rust\\src"); _debugger.ProcessExited += (a, b) => _hasExited = true; }
private static VariableTree GetVariables(DebuggerApi api, Variable variable, int level) { var children = variable.HasChildren && level <= MaxLevel?api.GetCurrentVariables(variable.Id) : new List <Variable>(); return(new VariableTree { CurrentItem = variable, Children = children.Select(x => GetVariables(api, x, level + 1)).ToList() }); }
private static VariableTree GetVariables(DebuggerApi api, Scope scope) { var variables = api.GetCurrentVariables(scope.Id); return(new VariableTree { CurrentItem = new Variable(scope.Id, scope.Name, string.Empty, string.Empty, true), Children = variables.Select(x => GetVariables(api, x, 0)).ToList() }); }
public static VariableTree GetAllLocals(this DebuggerApi api) { var mainThread = api.GetCurrentThreads().First(); var frame = api.GetCurrentStackTrace(mainThread.Id).First(); var scopes = api.GetCurrentScopes(frame.Id); return(new VariableTree { CurrentItem = new Variable(-1, "Root", string.Empty, "Root", true), Children = scopes.Select(x => GetVariables(api, x)).ToList() }); }