ISymbolWriter.DefineLocalVariable(String, FieldAttributes, Byte[], SymAddressKind, Int32, Int32, Int32, Int32, Int32) 方法

定义

在当前词法范围内定义单个变量。Defines a single variable in the current lexical scope.

public:
 void DefineLocalVariable(System::String ^ name, System::Reflection::FieldAttributes attributes, cli::array <System::Byte> ^ signature, System::Diagnostics::SymbolStore::SymAddressKind addrKind, int addr1, int addr2, int addr3, int startOffset, int endOffset);
public void DefineLocalVariable (string name, System.Reflection.FieldAttributes attributes, byte[] signature, System.Diagnostics.SymbolStore.SymAddressKind addrKind, int addr1, int addr2, int addr3, int startOffset, int endOffset);
abstract member DefineLocalVariable : string * System.Reflection.FieldAttributes * byte[] * System.Diagnostics.SymbolStore.SymAddressKind * int * int * int * int * int -> unit
Public Sub DefineLocalVariable (name As String, attributes As FieldAttributes, signature As Byte(), addrKind As SymAddressKind, addr1 As Integer, addr2 As Integer, addr3 As Integer, startOffset As Integer, endOffset As Integer)

参数

name
String

局部变量名称。The local variable name.

attributes
FieldAttributes

局部变量特性的按位组合。A bitwise combination of the local variable attributes.

signature
Byte[]

局部变量签名。The local variable signature.

addrKind
SymAddressKind

addr1addr2addr3 的地址类型。The address types for addr1, addr2, and addr3.

addr1
Int32

局部变量规格的第一个地址。The first address for the local variable specification.

addr2
Int32

局部变量规格的第二个地址。The second address for the local variable specification.

addr3
Int32

局部变量规格的第三个地址。The third address for the local variable specification.

startOffset
Int32

变量的起始偏移量。The start offset for the variable. 如果此参数为零,则忽略此参数,并在整个范围内定义该变量。If this parameter is zero, it is ignored and the variable is defined throughout the entire scope. 如果此参数为非 0,则该变量将位于当前范围的偏移量之内。If the parameter is nonzero, the variable falls within the offsets of the current scope.

endOffset
Int32

变量的结束偏移量。The end offset for the variable. 如果此参数为零,则忽略此参数,并在整个范围内定义该变量。If this parameter is zero, it is ignored and the variable is defined throughout the entire scope. 如果此参数为非 0,则该变量将位于当前范围的偏移量之内。If the parameter is nonzero, the variable falls within the offsets of the current scope.

注解

startOffsetendOffset 参数是可选的。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.

对于同一名称的变量,可在整个范围内的不同偏移范围内多次调用 DefineLocalVariableYou can call DefineLocalVariable 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.)

适用于