public SequencePoint(Instruction instruction, Document document) { if (document == null) { throw new ArgumentNullException("document"); } this.offset = new InstructionOffset(instruction); this.document = document; }
internal SequencePoint(int offset, Document document) { if (document == null) { throw new ArgumentNullException("document"); } this.offset = new InstructionOffset(offset); this.document = document; }
public ScopeDebugInformation(Instruction start, Instruction end) : this() { if (start == null) { throw new ArgumentNullException("start"); } this.start = new InstructionOffset(start); if (end != null) { this.end = new InstructionOffset(end); } }
public StateMachineScope(Instruction start, Instruction end) { this.start = new InstructionOffset(start); this.end = end != null ? new InstructionOffset(end) : new InstructionOffset(); }
internal StateMachineScope(int start, int end) { this.start = new InstructionOffset(start); this.end = new InstructionOffset(end); }
public AsyncMethodBodyDebugInformation() : base(KindIdentifier) { this.catch_handler = new InstructionOffset(-1); }
internal AsyncMethodBodyDebugInformation(int catchHandler) : base(KindIdentifier) { this.catch_handler = new InstructionOffset(catchHandler); }
InstructionOffset ResolveInstructionOffset(InstructionOffset inputOffset, ref InstructionOffsetCache cache) { if (inputOffset.IsResolved) { return(inputOffset); } int offset = inputOffset.Offset; if (cache.Offset == offset) { return(new InstructionOffset(cache.Instruction)); } if (cache.Offset > offset) { // This should be rare - we're resolving offset pointing to a place before the current cache position // resolve by walking the instructions from start and don't cache the result. int size = 0; for (int i = 0; i < items.Length; i++) { if (size == offset) { return(new InstructionOffset(items [i])); } if (size > offset) { return(new InstructionOffset(items [i - 1])); } size += items [i].GetSize(); } // Offset is larger than the size of the body - so it points after the end return(new InstructionOffset()); } else { // The offset points after the current cache position - so continue counting and update the cache int size = cache.Offset; for (int i = cache.Index; i < items.Length; i++) { cache.Index = i; cache.Offset = size; cache.Instruction = items [i]; if (cache.Offset == offset) { return(new InstructionOffset(cache.Instruction)); } if (cache.Offset > offset) { return(new InstructionOffset(items [i - 1])); } size += items [i].GetSize(); } return(new InstructionOffset()); } }