ISymbolWriter.DefineLocalVariable 方法

定義

在目前的語彙範圍中定義單一變數。

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

區域變數名稱。

attributes
FieldAttributes

區域變數屬性的位元組合。

signature
Byte[]

區域變數簽章。

addrKind
SymAddressKind

addr1addr2addr3 的位址類型。

addr1
Int32

區域變數規格的第一個位址。

addr2
Int32

區域變數規格的第二個位址。

addr3
Int32

區域變數規格的第三個位址。

startOffset
Int32

變數的起始位移。 如果這個參數是零,則會忽略它,並定義整個範圍的變數。 如果這個參數不是零,該變數便會落在目前範圍的位移內。

endOffset
Int32

變數的結束位移。 如果這個參數是零,則會忽略它,並定義整個範圍的變數。 如果這個參數不是零,該變數便會落在目前範圍的位移內。

備註

startOffsetendOffset 參數為選用參數。 如果其值為零,則會忽略它們,而且變數會在整個範圍內定義。 如果其值為非零,則變數會落在目前範圍的位移內。

您可以針對相同名稱的變數呼叫 DefineLocalVariable 多次,該變數會在整個範圍的不同位移範圍中多次發生。 (在此情況下,開始和結束位移不得重疊。)

適用於