符號和符號標記Symbols and Symbol Tags

已編譯器的 Debug 資訊會儲存在程式資料庫 ( .pdb) 檔中,做為可使用 Debug 介面存取 (DIA) SDK Api 存取的符號。Debug information about a compiled program is stored in the program database (.pdb) file as symbols that are accessible using the Debug Interface Access (DIA) SDK APIs. 所有符號都有 IDiaSymbol:: get_symTagIDiaSymbol:: get_symIndexId 屬性。All symbols have a IDiaSymbol::get_symTag and a IDiaSymbol::get_symIndexId property. symTag屬性工作表示SymTagEnum 列舉列舉所定義的符號種類。The symTag property indicates the kind of symbol as defined by the SymTagEnum Enumeration enumeration. symIndexId屬性是一個 DWORD 值,其中包含每個符號實例的唯一識別碼。The symIndexId property is a DWORD value that contains the unique identifier for every instance of a symbol.

符號的屬性也可以指定符號的其他相關資訊,以及其他符號的參考,最常是 IDiaSymbol:: get_lexicalParentIDiaSymbol:: get_classParentSymbols also have properties that can specify additional information about the symbol as well as references to other symbols, most often a IDiaSymbol::get_lexicalParent or IDiaSymbol::get_classParent. 當您查詢包含參考的屬性時,參考會以 IDiaSymbol 物件的形式傳回。When you query a property that contains a reference, the reference is returned as an IDiaSymbol object. 這類屬性一律會與另一個具有相同名稱的屬性配對,但尾碼為 "Id",例如, IDiaSymbol:: get_lexicalParentIdIDiaSymbol:: get_classParentIdSuch properties are always paired with another property by the same name but suffixed with "Id", for example, IDiaSymbol::get_lexicalParentId and IDiaSymbol::get_classParentId. 符號 位置中的資料表、 符號類型的詞法階層,以及 符號類型的類別 階層,會針對每個不同種類的符號來概述其屬性。The tables in Symbol Locations, Lexical Hierarchy of Symbol Types, and Class Hierarchy of Symbol Types outline the properties for each of the different kinds of symbols. 這些屬性可能會有有關或參考其他符號的相關資訊。These properties may have relevant information about or references to other symbols. 因為 *Id 屬性只是其相關屬性的數值序數識別碼,所以會從進一步的討論中省略它們。Because the *Id properties are simply numeric ordinal identifiers of their related properties, they are omitted from further discussions. 它們只是參考參數說明所需的位置。They are referred to only where needed for parameter clarification.

嘗試存取屬性時,如果沒有發生錯誤,而且已將值指派給 symbol 屬性,則屬性的 "get" 方法會傳回 S_OKWhen trying to access the property, if no error occurs and the symbol property has been assigned a value, the property's "get" method returns S_OK. 的傳回值 S_FALSE 表示屬性對目前的符號而言是不正確。A return value of S_FALSE indicates that the property is not valid for the current symbol.

本節內容In This Section

符號位置Symbol Locations

描述項號可以有的不同位置種類。Describes the different kinds of locations a symbol can have.

符號類型的語彙階層架構Lexical Hierarchy of Symbol Types

描述形成詞彙階層的符號類型,例如檔案、模組和函式。Describes the symbol types that form lexical hierarchies such as files, modules, and functions.

符號類型的類別階層架構Class Hierarchy of Symbol Types

描述對應至不同語言專案(例如類別、陣列和函式傳回類型)的符號類型。Describes the symbol types that correspond to different language elements such as classes, arrays, and function return types.

另請參閱See also