PERWAPI.PDBWriter.BindLocal C# (CSharp) Метод

BindLocal() публичный Метод

Bind a local to the current scope.
public BindLocal ( string name, int idx, uint token, int startOffset, int endOffset ) : void
name string The name of the variable.
idx int The index of the variable in the locals table.
token uint The symbol token for the given variable.
startOffset int The starting offset for the binding. Set to 0 to default to current scope.
endOffset int The ending offset for the binding. Set to 0 to default to current scope.
Результат void
        public void BindLocal(string name, int idx, uint token, int startOffset, int endOffset)
        {
            // Check to make sure a scope is open
            if (currentScope == null)
                throw new Exception("You must have an open scope in order to bind locals.");

            // Create the new local binding object
            LocalBinding lb = new LocalBinding();
            lb.Name = name;
            lb.Index = idx;
            lb.Token = new SymbolToken((int)token);
            lb.OffsetStart = startOffset;
            lb.OffsetEnd = endOffset;

            // Add to the current scope
            currentScope.Locals.Add(lb);
        }

Usage Example

Пример #1
0
        internal void WriteLocals(PDBWriter writer)
        {
            try {

             Local[] locals = _thisMeth.GetLocals();

             foreach (LocalBinding binding in _localBindings) {
                 writer.BindLocal(binding._name, binding._index, _thisMeth.locToken,0,0);
             }
             } catch (Exception e) {
             throw new Exception("Exception while writing debug info for: " +
                 this._thisMeth.NameString()+"\r\n"+e.ToString(),e);
             }
        }