Symbols and Symbol Tags

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

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. All symbols have a IDiaSymbol::get_symTag and a IDiaSymbol::get_symIndexId property. The symTag property indicates the kind of symbol as defined by the SymTagEnum Enumeration enumeration. The symIndexId property is a DWORD value that contains the unique identifier for every instance of a symbol.

Symbols 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. When you query a property that contains a reference, the reference is returned as an IDiaSymbol object. Such 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. 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.

When 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. 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