語言

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

地址類型 addr1分別為 、 addr2、 addr3和 。

addr1
Int32

這是區域變數規範的第一個地址。

addr2
Int32

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

addr3
Int32

第三個位址是區域變數規範。

startOffset
Int32

變數的起始偏移。 若參數為零,則忽略該變數,並定義整個作用域。 若參數非零,則該變數位於當前作用域的偏移量範圍內。

endOffset
Int32

變數的端點偏移。 若參數為零,則忽略該變數,並定義整個作用域。 若參數非零,則該變數位於當前作用域的偏移量範圍內。

備註

startOffset和endOffset參數是可選的。 若值為零,則忽略變數,並定義整個作用域。 若其值非零,則該變數位於當前範圍的偏移量範圍內。

你可以多次呼叫 DefineLocalVariable 同名變數,且在作用波中不同偏移範圍內多次出現。 (此時起始與結束偏移量不得重疊。)

適用於