public override void WriteToolTip(ITextColorWriter output, DbgCodeBreakpointFilter filter) { if (output == null) { throw new ArgumentNullException(nameof(output)); } var defaultColor = BoxedTextColor.Text; WriteArgumentAndText(output, defaultColor, dnSpy_Debugger_Resources.Breakpoint_Filter_Filter, () => dbgFilterExpressionEvaluatorService.Value.Write(output, filter.Filter ?? string.Empty)); }
void Save(ISettingsSection section, DbgCodeBreakpointFilter settings) => section.Attribute("Filter", settings.Filter);
public override DbgCodeBreakpointCheckResult ShouldBreak(DbgBoundCodeBreakpoint boundBreakpoint, DbgThread thread, DbgCodeBreakpointFilter filter) { if (!dbgFilterExpressionEvaluatorService.HasExpressionEvaluator) { // There's no need to localize it, the FEE is exported by the Roslyn code return(new DbgCodeBreakpointCheckResult("There's no filter expression evaluator")); } var expr = filter.Filter; Debug.Assert(expr != null); if (expr == null) { return(new DbgCodeBreakpointCheckResult("Missing expression")); } try { dbgFilterEEVariableProvider.Initialize(boundBreakpoint.Process, thread); var res = dbgFilterExpressionEvaluatorService.Evaluate(expr, dbgFilterEEVariableProvider); if (res.HasError) { return(new DbgCodeBreakpointCheckResult(res.Error)); } return(new DbgCodeBreakpointCheckResult(res.Result)); } finally { dbgFilterEEVariableProvider.Clear(); } }
public abstract DbgCodeBreakpointCheckResult ShouldBreak(DbgBoundCodeBreakpoint boundBreakpoint, DbgThread thread, DbgCodeBreakpointFilter filter);
public abstract void WriteToolTip(ITextColorWriter output, DbgCodeBreakpointFilter filter);
public override bool ShouldBreak(DbgBoundCodeBreakpoint boundBreakpoint, DbgThread thread, DbgCodeBreakpointFilter filter) { // If there's no FEE, assume expression matches everything if (!dbgFilterExpressionEvaluatorService.HasExpressionEvaluator) { return(true); } var expr = filter.Filter; Debug.Assert(expr != null); if (expr == null) { return(false); } try { dbgFilterEEVariableProvider.Initialize(boundBreakpoint.Process, thread); var res = dbgFilterExpressionEvaluatorService.Evaluate(expr, dbgFilterEEVariableProvider); if (res.HasError) { return(false); //TODO: Notify user too, but only at most once per breakpoint } return(res.Result); } finally { dbgFilterEEVariableProvider.Clear(); } }
public abstract bool ShouldBreak(DbgBoundCodeBreakpoint boundBreakpoint, DbgThread thread, DbgCodeBreakpointFilter filter);