語言

SymWriter.DefineLocalVariable 方法

定義

定義了目前詞彙範疇中的單一變數。

public:
 override 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:
 virtual 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 override 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);
public virtual 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
override this.DefineLocalVariable : string * System.Reflection.FieldAttributes * byte[] * System.Diagnostics.SymbolStore.SymAddressKind * int * int * int * int * int -> unit
Public Overrides 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)
Public Overridable 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

這些是透過列 FieldAttributes 舉器指定的區域變數屬性。

signature
Byte[]

區域變數簽名。

addrKind
SymAddressKind

位址類型中 addr1、 addr2、 以及 addr3 使用 SymAddressKind。

addr1
Int32

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

addr2
Int32

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

addr3
Int32

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

startOffset
Int32

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

endOffset
Int32

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

實作

備註

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

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

適用於