Exemplo n.º 1
0
 IXamlILEmitter Emit(Instruction i)
 {
     _body.Instructions.Add(i);
     if (_pendingDebugPoint != null)
     {
         _pendingDebugPoint.Create(i);
         _pendingDebugPoint = null;
     }
     foreach (var ml in _markedLabels)
     {
         ml.Mark(i);
     }
     _markedLabels.Clear();
     return(this);
 }
Exemplo n.º 2
0
            public void InsertSequencePoint(IFileSource file, int line, int position)
            {
                if (!_documents.TryGetValue(_method.Module.Assembly, out var documents))
                {
                    _documents.Add(_method.Module.Assembly, documents = new Dictionary <string, DocumentHelper>());
                }

                if (!documents.TryGetValue(file.FilePath, out var doc))
                {
                    documents[file.FilePath] = doc = new DocumentHelper(file);
                }

                if (_pendingDebugPoint == null)
                {
                    if (_lastDebugPoint == null ||
                        !(_lastDebugPoint.Document == doc && _lastDebugPoint.Line == line &&
                          _lastDebugPoint.Position == position))
                    {
                        _pendingDebugPoint = _lastDebugPoint = new CecilDebugPoint(this, doc, line, position);
                    }
                }
            }
Exemplo n.º 3
0
 IXamlIlEmitter Emit(Instruction i)
 {
     _body.Instructions.Add(i);
     if (_pendingDebugPoint != null)
     {
         _pendingDebugPoint.Create(i);
         _pendingDebugPoint = null;
     }
     foreach (var ml in _markedLabels)
     {
         foreach (var instruction in _body.Instructions)
         {
             if (instruction.Operand == ml.Instruction)
             {
                 instruction.Operand = i;
             }
         }
         ml.Instruction = i;
     }
     _markedLabels.Clear();
     return(this);
 }