System.Diagnostics.SymbolStore.ISymbolWriter.DefineLocalVariable Method

Defines a single variable in the current lexical scope.

Syntax

public void DefineLocalVariable (string name, System.Reflection.FieldAttributes attributes, byte[] signature, SymAddressKind addrKind, int addr1, int addr2, int addr3, int startOffset, int endOffset)

Parameters

name
The local variable name.
attributes
A bitwise combination of the local variable attributes.
signature
The local variable signature.
addrKind
The address types for addr1, addr2, and addr3.
addr1
The first address for the local variable specification.
addr2
The second address for the local variable specification.
addr3
The third address for the local variable specification.
startOffset
The start offset for the variable. If this parameter is zero, it is ignored and the variable is defined throughout the entire scope. If the parameter is nonzero, the variable falls within the offsets of the current scope.
endOffset
The end offset for the variable. If this parameter is zero, it is ignored and the variable is defined throughout the entire scope. If the parameter is nonzero, the variable falls within the offsets of the current scope.

Remarks

The startOffset and endOffset parameters are optional. If their value is zero, they are ignored and the variable is defined throughout the entire scope. If their value is nonzero, the variable falls within the offsets of the current scope.

You can call ISymbolWriter.DefineLocalVariable(string, System.Reflection.FieldAttributes, Byte[], SymAddressKind, int, int, int, int, int) multiple times for a variable of the same name that occurs multiple times in different offset ranges throughout a scope. (In this case, start and end offsets must not overlap.)

Requirements

Namespace: System.Diagnostics.SymbolStore
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0