Beispiel #1
0
 /// <summary>
 /// Creates an evaluation context
 /// </summary>
 /// <param name="frame">Stack frame</param>
 /// <param name="options">Options</param>
 /// <param name="funcEvalTimeout">Func-eval timeout (func-eval = calling functions in the debugged process) or default instance to use default timeout value</param>
 /// <param name="cancellationToken">Cancellation token</param>
 /// <returns></returns>
 public DbgEvaluationContext CreateContext(DbgStackFrame frame, DbgEvaluationContextOptions options = DbgEvaluationContextOptions.None, TimeSpan funcEvalTimeout = default, CancellationToken cancellationToken = default)
 {
     if (frame == null)
     {
         throw new ArgumentNullException(nameof(frame));
     }
     return(CreateContext(frame.Runtime, frame.Location, options, funcEvalTimeout, cancellationToken));
 }
Beispiel #2
0
 public DbgEvaluationContextImpl(DbgLanguage language, DbgRuntime runtime, TimeSpan funcEvalTimeout, DbgEvaluationContextOptions options)
 {
     lockObj                 = new object();
     Language                = language ?? throw new ArgumentNullException(nameof(language));
     Runtime                 = runtime ?? throw new ArgumentNullException(nameof(runtime));
     FuncEvalTimeout         = funcEvalTimeout;
     Options                 = options;
     continueContext         = new DbgContinueContext();
     continueContext.Closed += DbgContinueContext_Closed;
     runtime.CloseOnContinue(continueContext);
 }
Beispiel #3
0
        public override DbgEvaluationContext CreateContext(DbgRuntime runtime, DbgCodeLocation location, DbgEvaluationContextOptions options, TimeSpan funcEvalTimeout, CancellationToken cancellationToken)
        {
            if (runtime == null)
            {
                throw new ArgumentNullException(nameof(runtime));
            }
            if (runtime.RuntimeKindGuid != RuntimeKindGuid)
            {
                throw new ArgumentException();
            }
            if (funcEvalTimeout == TimeSpan.Zero)
            {
                funcEvalTimeout = DefaultFuncEvalTimeout;
            }
            var context = new DbgEvaluationContextImpl(this, runtime, funcEvalTimeout, options);

            try {
                engineLanguage.InitializeContext(context, location, cancellationToken);
            }
            catch {
                context.Close();
                throw;
            }
            return(context);
        }
Beispiel #4
0
		/// <summary>
		/// Creates an evaluation context
		/// </summary>
		/// <param name="runtime">Runtime</param>
		/// <param name="location">Location or null</param>
		/// <param name="options">Options</param>
		/// <param name="funcEvalTimeout">Func-eval timeout (func-eval = calling functions in the debugged process) or default instance to use default timeout value</param>
		/// <param name="cancellationToken">Cancellation token</param>
		/// <returns></returns>
		public abstract DbgEvaluationContext CreateContext(DbgRuntime runtime, DbgCodeLocation? location, DbgEvaluationContextOptions options = DbgEvaluationContextOptions.None, TimeSpan funcEvalTimeout = default, CancellationToken cancellationToken = default);