示例#1
0
        public override DbgValueNode[] Create(DbgEvaluationContext context, DbgStackFrame frame, DbgObjectId[] objectIds, DbgValueNodeEvaluationOptions options, CancellationToken cancellationToken)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (!(context is DbgEvaluationContextImpl))
            {
                throw new ArgumentException();
            }
            if (context.Language != Language)
            {
                throw new ArgumentException();
            }
            if (context.Runtime.RuntimeKindGuid != runtimeKindGuid)
            {
                throw new ArgumentException();
            }
            if (frame == null)
            {
                throw new ArgumentNullException(nameof(frame));
            }
            if (frame.Runtime.RuntimeKindGuid != runtimeKindGuid)
            {
                throw new ArgumentException();
            }
            if (objectIds == null)
            {
                throw new ArgumentNullException(nameof(objectIds));
            }
            if (objectIds.Length == 0)
            {
                return(Array.Empty <DbgValueNode>());
            }
            var runtime = objectIds[0].Runtime;

            if (runtime.RuntimeKindGuid != runtimeKindGuid)
            {
                throw new ArgumentException();
            }
            var engineObjectIds = new DbgEngineObjectId[objectIds.Length];

            for (int i = 0; i < objectIds.Length; i++)
            {
                engineObjectIds[i] = ((DbgObjectIdImpl)objectIds[i]).EngineObjectId;
            }
            return(CreateResult(runtime, engineValueNodeFactory.Create(context, frame, engineObjectIds, options, cancellationToken), engineObjectIds.Length));
        }
示例#2
0
        public override DbgValueNode[] Create(DbgEvaluationInfo evalInfo, DbgObjectId[] objectIds, DbgValueNodeEvaluationOptions options)
        {
            if (evalInfo is null)
            {
                throw new ArgumentNullException(nameof(evalInfo));
            }
            if (!(evalInfo.Context is DbgEvaluationContextImpl))
            {
                throw new ArgumentException();
            }
            if (evalInfo.Context.Language != Language)
            {
                throw new ArgumentException();
            }
            if (evalInfo.Context.Runtime.RuntimeKindGuid != runtimeKindGuid)
            {
                throw new ArgumentException();
            }
            if (objectIds is null)
            {
                throw new ArgumentNullException(nameof(objectIds));
            }
            if (objectIds.Length == 0)
            {
                return(Array.Empty <DbgValueNode>());
            }
            var runtime = objectIds[0].Runtime;

            if (runtime.RuntimeKindGuid != runtimeKindGuid)
            {
                throw new ArgumentException();
            }
            var engineObjectIds = new DbgEngineObjectId[objectIds.Length];

            for (int i = 0; i < objectIds.Length; i++)
            {
                engineObjectIds[i] = ((DbgObjectIdImpl)objectIds[i]).EngineObjectId;
            }
            return(CreateResult(runtime, engineValueNodeFactory.Create(evalInfo, engineObjectIds, options), engineObjectIds.Length));
        }
示例#3
0
 public DbgObjectIdImpl(DbgRuntimeObjectIdServiceImpl owner, DbgEngineObjectId engineObjectId)
 {
     this.owner     = owner ?? throw new ArgumentNullException(nameof(owner));
     EngineObjectId = engineObjectId ?? throw new ArgumentNullException(nameof(engineObjectId));
 }
 public override int GetHashCode(DbgEngineObjectId objectId) => 0;
 public override bool Equals(DbgEngineObjectId objectId, DbgEngineValue value) => false;
示例#6
0
 /// <summary>
 /// Gets the hash code of an object id
 /// </summary>
 /// <param name="objectId">Object id created by this class</param>
 /// <returns></returns>
 public sealed override int GetHashCode(DbgEngineObjectId objectId) => dbgEngineObjectIdFactory.GetHashCode(objectId);
示例#7
0
 /// <summary>
 /// Checks if an object id and a value refer to the same data
 /// </summary>
 /// <param name="objectId">Object id created by this class</param>
 /// <param name="value">Value created by this runtime</param>
 /// <returns></returns>
 public sealed override bool Equals(DbgEngineObjectId objectId, DbgEngineValue value) => dbgEngineObjectIdFactory.Equals(objectId, value);