Share via


IDiaSymbol

Describes the properties of a symbol instance.

IDiaSymbol : IUnknown

Methods in Alphabetical Order

The following table shows the methods of IDiaSymbol.

Note

Symbols will return meaningful data for only some of these methods, depending on the type of symbol. If a method returns S_OK, then that method has returned meaningful data.

Method

Description

IDiaSymbol::findChildren

Retrieves all children of the symbol.

IDiaSymbol::findChildrenEx

Retrieves the children of the symbol. This method is the extended version of IDiaSymbol::findChildren.

IDiaSymbol::findChildrenExByAddr

Retrieves the children of the symbol that are valid at a specified address.

IDiaSymbol::findChildrenExByRVA

Retrieves the children of the symbol that are valid at a specified relative virtual address (RVA).

IDiaSymbol::findChildrenExByVA

Retrieves the children of the symbol that are valid at a specified virtual address.

IDiaSymbol::findInlineFramesByAddr

Retrieves an enumeration that allows a client to iterate through all of the inline frames on a given address.

IDiaSymbol::findInlineFramesByRVA

Retrieves an enumeration that allows a client to iterate through all of the inline frames on a specified relative virtual address (RVA).

IDiaSymbol::findInlineFramesByVA

Retrieves an enumeration that allows a client to iterate through all of the inline frames on a specified virtual address (VA).

IDiaSymbol::findInlineeLines

Retrieves an enumeration that allows a client to iterate through the line number information of all functions that are inlined, directly or indirectly, in this symbol.

IDiaSymbol::findInlineeLinesByAddr

Retrieves an enumeration that allows a client to iterate through the line number information of all functions that are inlined, directly or indirectly, in this symbol within the specified address range.

IDiaSymbol::findInlineeLinesByRVA

Retrieves an enumeration that allows a client to iterate through the line number information of all functions that are inlined, directly or indirectly, in this symbol within the specified relative virtual address (RVA).

IDiaSymbol::findInlineeLinesByVA

Retrieves an enumeration that allows a client to iterate through the line number information of all functions that are inlined, directly or indirectly, in this symbol within the specified virtual address (VA).

IDiaSymbol::findSymbolsByRVAForAcceleratorPointerTag

Given a corresponding tag value, this method returns an enumeration of symbols that are contained in this stub function at a specified relative virtual address.

IDiaSymbol::findSymbolsForAcceleratorPointerTag

Returns the number of accelerator pointer tags in a C++ AMP stub function.

IDiaSymbol::get_acceleratorPointerTags

Returns all accelerator pointer tag values that correspond to a C++ AMP accelerator stub function.

IDiaSymbol::get_access

Retrieves the access modifier of a class member.

IDiaSymbol::get_addressOffset

Retrieves the offset part of an address location.

IDiaSymbol::get_addressSection

Retrieves the section part of an address location.

IDiaSymbol::get_addressTaken

Retrieves a flag indicating whether another symbol references this address.

IDiaSymbol::get_age

Retrieves the age value of a program database.

IDiaSymbol::get_arrayIndexType

Retrieves the symbol identifier of the array index type.

IDiaSymbol::get_arrayIndexTypeId

Retrieves the array index type identifier of the symbol.

IDiaSymbol::get_backEndMajor

Retrieves the back-end major version number.

IDiaSymbol::get_backEndMinor

Retrieves the back-end minor version number.

IDiaSymbol::get_backEndBuild

Retrieves the back-end build number.

IDiaSymbol::get_baseDataOffset

Retrieves the base data offset.

IDiaSymbol::get_baseDataSlot

Retrieves the base data slot.

IDiaSymbol::get_baseSymbol

Retrieves the symbol from which the pointer is based.

IDiaSymbol::get_baseSymbolId

Retrieves the symbol ID from which the pointer is based.

IDiaSymbol::get_baseType

Retrieves the type tag of a simple type.

IDiaSymbol::get_bitPosition

Retrieves the bit position of a location.

IDiaSymbol::get_builtInKind

Retrieves a built-in kind of the HLSL type.

IDiaSymbol::get_callingConvention

Returns an indicator of a method's calling convention.

IDiaSymbol::get_classParent

Retrieves a reference to the class parent of the symbol.

IDiaSymbol::get_classParentId

Retrieves the class parent identifier of the symbol.

IDiaSymbol::get_code

Retrieves a flag indicating whether the symbol refers to a code address.

IDiaSymbol::get_compilerGenerated

Retrieves a flag indicating whether the symbol was compiler-generated.

IDiaSymbol::get_compilerName

Retrieves the name of the compiler used to create the Compiland.

IDiaSymbol::get_constructor

Retrieves a flag indicating whether the user-defined data type has a constructor.

IDiaSymbol::get_container

Retrieves the containing symbol of this symbol.

IDiaSymbol::get_constType

Retrieves a flag indicating whether the user-defined data type is constant.

IDiaSymbol::get_count

Retrieves the number of items in a list or array.

IDiaSymbol::get_countLiveRanges

Retrieves the number of valid address ranges associated with the local symbol.

IDiaSymbol::get_customCallingConvention

Retrieves a flag indicating whether the function uses a custom calling convention.

IDiaSymbol::get_dataBytes

Retrieves the data bytes of an OEM symbol.

IDiaSymbol::get_dataKind

Retrieves the variable classification of a data symbol.

IDiaSymbol::get_editAndContinueEnabled

Retrieves the flag describing the Edit and Continue features of the compiled program or unit.

IDiaSymbol::get_farReturn

Retrieves a flag indicating whether the function uses a far return.

IDiaSymbol::get_frontEndMajor

Retrieves the front-end major version number.

IDiaSymbol::get_frontEndMinor

Retrieves the front-end minor version number.

IDiaSymbol::get_frontEndBuild

Retrieves the front-end build number.

IDiaSymbol::get_function

Retrieves a flag indicating whether the public symbol refers to a function.

IDiaSymbol::get_guid

Retrieves the symbol's GUID.

IDiaSymbol::get_hasAlloca

Retrieves a flag indicating whether the function contains a call to alloca.

IDiaSymbol::get_hasAssignmentOperator

Retrieves a flag indicating whether the user-defined data type has any assignment operators defined.

IDiaSymbol::get_hasCastOperator

Retrieves a flag indicating whether the user-defined data type has any cast operators defined.

IDiaSymbol::get_hasDebugInfo

Retrieves a flag indicating whether the compiland contains any debugging information.

IDiaSymbol::get_hasEH

Retrieves a flag indicating whether the function has a C++-style exception handler.

IDiaSymbol::get_hasEHa

Retrieves a flag indicating whether the function has an asynchronous exception handler.

IDiaSymbol::get_hasInlAsm

Retrieves a flag indicating whether the function has inline assembly.

IDiaSymbol::get_hasLongJump

Retrieves a flag indicating whether the function contains a longjmp command (part of C-style exception handling).

IDiaSymbol::get_hasManagedCode

Retrieves a flag indicating whether the module contains managed code.

IDiaSymbol::get_hasNestedTypes

Retrieves a flag indicating whether the user-defined data type has nested type definitions.

IDiaSymbol::get_hasSecurityChecks

Retrieves a flag indicating whether the function or compiland has security checks compiled in (via the /GS (Buffer Security Check) compiler switch).

IDiaSymbol::get_hasSEH

Retrieves a flag indicating whether the function has Win32-style Structured Exception Handling.

IDiaSymbol::get_hasSetJump

Retrieves a flag indicating whether the function contains a setjmp command.

IDiaSymbol::get_indirectVirtualBaseClass

Retrieves a flag indicating whether the user-defined data type is an indirect virtual base class.

IDiaSymbol::get_InlSpec

Retrieves a flag indicating whether the function has been marked with the inline attribute.

IDiaSymbol::get_interruptReturn

Retrieves a flag indicating whether the function has a return from interrupt instruction.

IDiaSymbol::get_intro

Retrieves a flag indicating whether the function is the base class virtual function.

IDiaSymbol::get_isAcceleratorGroupSharedLocal

Retrieves a flag that indicates whether the symbol corresponds to a group shared local variable in code compiled for a C++ AMP Accelerator.

IDiaSymbol::get_isAcceleratorPointerTagLiveRange

Retrieves a flag that indicates whether the symbol corresponds to the definition range symbol for the tag component of a pointer variable in code compiled for a C++ AMP Accelerator. The definition range symbol is the location of a variable for a span of addresses.

IDiaSymbol::get_isAcceleratorStubFunction

Indicates whether the symbol corresponds to a top-level function symbol for a shader compiled for an accelerator that corresponds to a parallel_for_each call.

IDiaSymbol::get_isAggregated

Retrieves a flag indicating whether the data is part of an aggregate of many symbols.

IDiaSymbol::get_isCTypes

Retrieves a flag indicating whether the symbol file contains C types.

IDiaSymbol::get_isCVTCIL

Retrieves a flag indicating whether the module was converted from Common Intermediate Language (CIL) to native code.

IDiaSymbol::get_isDataAligned

Retrieves a flag indicating whether the elements of a user-defined data type are aligned to a specific boundary.

IDiaSymbol::get_isHLSLData

Specifies whether this symbol represents High Level Shader Language (HLSL) data.

IDiaSymbol::get_isHotpatchable

Retrieves a flag indicating whether the module was compiled with the /hotpatch (Create Hotpatchable Image) compiler switch.

IDiaSymbol::get_isLTCG

Retrieves a flag indicating whether the managed compiland was linked with the linker's LTCG.

IDiaSymbol::get_isMatrixRowMajor

Specifies whether the matrix is row major.

IDiaSymbol::get_isMSILNetmodule

Retrieves a flag indicating whether the managed compiland is a .netmodule (containing only metadata).

IDiaSymbol::get_isMultipleInheritance

Specifies whether the this pointer points to a data member with multiple inheritance.

IDiaSymbol::get_isNaked

Retrieves a flag indicating whether the function has the naked (C++) attribute.

IDiaSymbol::get_isOptimizedAway

Specifies whether the variable is optimized away.

IDiaSymbol::get_isPointerBasedOnSymbolValue

Specifies whether the this pointer is based on a symbol value.

IDiaSymbol::get_isPointerToDataMember

Specifies whether this symbol is a pointer to a data member.

IDiaSymbol::get_isPointerToMemberFunction

Specifies whether this symbol is a pointer to a member function.

IDiaSymbol::get_isReturnValue

Specifies whether the variable carries a return value.

IDiaSymbol::get_isSdl

Specifies whether the module is compiled with the /SDL option.

IDiaSymbol::get_isSingleInheritance

Specifies whether the this pointer points to a data member with single inheritance.

IDiaSymbol::get_isSplitted

Retrieves a flag indicating whether the data has been split into an aggregate of separate symbols.

IDiaSymbol::get_isStatic

Retrieves a flag indicating whether a function or thunk layer is static.

IDiaSymbol::get_isStripped

Retrieves a flag indicating whether private symbols have been stripped from the symbol file.

IDiaSymbol::get_isVirtualInheritance

Specifies whether the this pointer points to a data member with virtual inheritance.

IDiaSymbol::get_language

Retrieves the language of the source.

IDiaSymbol::get_length

Retrieves the number of bytes of memory used by the object represented by this symbol.

IDiaSymbol::get_lexicalParent

Retrieves a reference to the lexical parent of the symbol.

IDiaSymbol::get_lexicalParentId

Retrieves the lexical parent identifier of the symbol.

IDiaSymbol::get_libraryName

Retrieves the file name of the library or object file from which the object was loaded.

IDiaSymbol::get_liveRangeLength

Returns the length of the address range in which the local symbol is valid.

IDiaSymbol::get_liveRangeStartAddressSection

Returns the section part of the starting address range in which the local symbol is valid.

IDiaSymbol::get_liveRangeStartAddressOffset

Returns the offset part of the starting address range in which the local symbol is valid.

IDiaSymbol::get_liveRangeStartRelativeVirtualAddress

Returns the start of the address range in which the local symbol is valid.

IDiaSymbol::get_locationType

Retrieves the location type of a data symbol.

IDiaSymbol::get_lowerBound

Retrieves the lower bound of a FORTRAN array dimension.

IDiaSymbol::get_lowerBoundId

Retrieves the symbol identifier of the lower bound of a FORTRAN array dimension.

IDiaSymbol::get_machineType

Retrieves the type of the target CPU.

IDiaSymbol::get_managed

Retrieves a flag that indicating whether the symbol refers to managed code.

IDiaSymbol::get_memorySpaceKind

Retrieves the memory space kind.

IDiaSymbol::get_msil

Retrieves a flag indicating whether the symbol refers to Microsoft Intermediate Language (MSIL) code.

IDiaSymbol::get_name

Retrieves the name of the symbol.

IDiaSymbol::get_nested

Retrieves a flag indicating whether the user-defined data type is nested.

IDiaSymbol::get_noInline

Retrieves a flag indicating whether the function is marked with the noinline attribute.

IDiaSymbol::get_noReturn

Retrieves a flag indicating whether the function has been declared with the noreturn attribute.

IDiaSymbol::get_noStackOrdering

Retrieves a flag indicating whether no stack ordering could be done as part of stack buffer checking.

IDiaSymbol::get_notReached

Retrieves a flag indicating whether the function or label is never reached.

IDiaSymbol::get_numberOfAcceleratorPointerTags

Returns the number of accelerator pointer tags in a C++ AMP stub function.

IDiaSymbol::get_numberOfModifiers

Retrieves the number of modifiers that are applied to the original type.

IDiaSymbol::get_numberOfRegisterIndices

Retrieves the number of register indices.

IDiaSymbol::get_numberOfRows

Retrieves the number of rows in the matrix.

IDiaSymbol::get_numberOfColumns

Retrieves the number of columns in the matrix.

IDiaSymbol::get_objectFileName

Retrieves the object file name.

IDiaSymbol::get_objectPointerType

Retrieves the type of the object pointer for a class method.

IDiaSymbol::get_oemId

Retrieves the symbol's oemId value.

IDiaSymbol::get_oemSymbolId

Retrieves the symbol's oemSymbolId value.

IDiaSymbol::get_offset

Retrieves the offset of the symbol location.

IDiaSymbol::get_optimizedCodeDebugInfo

Retrieves a flag indicating whether the function or label contains optimized code as well as debug information.

IDiaSymbol::get_overloadedOperator

Retrieves a flag indicating whether the user-defined data type has overloaded operators.

IDiaSymbol::get_packed

Retrieves a flag indicating whether the user-defined data type is packed.

IDiaSymbol::get_platform

Retrieves the platform type for which the program or compiland was compiled.

IDiaSymbol::get_pure

Retrieves a flag that indicating whether the function is pure virtual.

IDiaSymbol::get_rank

Retrieves the rank of a FORTRAN multidimensional array.

IDiaSymbol::get_reference

Retrieves a flag indicating whether a pointer type is a reference.

IDiaSymbol::get_registerId

Retrieves the register designator of the location.

IDiaSymbol::get_registerType

Retrieves the register type.

IDiaSymbol::get_relativeVirtualAddress

Retrieves the relative virtual address (RVA) of the location.

IDiaSymbol::get_restrictedType

Specifies whether the this pointer is flagged as restricted.

IDiaSymbol::get_samplerSlot

Retrieves the sampler slot.

IDiaSymbol::get_scoped

Retrieves a flag indicating whether the user-defined data type appears in a nonglobal lexical scope.

IDiaSymbol::get_signature

Retrieves the symbol's signature value.

IDiaSymbol::get_sizeInUdt

Retrieves the size of a member of a user-defined type.

IDiaSymbol::get_slot

Retrieves the slot number of the location.

IDiaSymbol::get_sourceFileName

Retrieves the file name of the source file.

IDiaSymbol::getSrcLineOnTypeDefn

Retrieves the source file and line number that indicate where a specified user-defined type is defined.

IDiaSymbol::get_stride

Retrieves the stride of the matrix or strided array.

IDiaSymbol::get_subType

Retrieves the sub type.

IDiaSymbol::get_subTypeId

Retrieves the sub type ID.

IDiaSymbol::get_symbolsFileName

Retrieves the name of the file from which the symbols were loaded.

IDiaSymbol::get_symIndexId

Retrieves the unique symbol identifier.

IDiaSymbol::get_symTag

Retrieves the symbol type classifier.

IDiaSymbol::get_targetOffset

Retrieves the offset section of a thunk target.

IDiaSymbol::get_targetRelativeVirtualAddress

Retrieves the relative virtual address (RVA) of a thunk target.

IDiaSymbol::get_targetSection

Retrieves the address section of a thunk target.

IDiaSymbol::get_targetVirtualAddress

Retrieves the virtual address (VA) of a thunk target.

IDiaSymbol::get_textureSlot

Retrieves the texture slot.

IDiaSymbol::get_thisAdjust

Retrieves the logical this adjustor for the method.

IDiaSymbol::get_thunkOrdinal

Retrieves the thunk type of a function.

IDiaSymbol::get_timeStamp

Retrieves the timestamp of the underlying executable file.

IDiaSymbol::get_token

Retrieves the metadata token of a managed function or variable.

IDiaSymbol::get_type

Retrieves a reference to the function signature.

IDiaSymbol::get_typeId

Retrieves the type identifier of the symbol.

IDiaSymbol::get_types

Retrieves an array of compiler-specific type values for this symbol.

IDiaSymbol::get_typeIds

Retrieves an array of compiler-specific type identifier values for this symbol.

IDiaSymbol::get_uavSlot

Retrieves the uav slot.

IDiaSymbol::get_udtKind

Retrieves the variety of a user-defined type (UDT).

IDiaSymbol::get_unalignedType

Retrieves a flag indicating whether the user-defined data type is unaligned.

IDiaSymbol::get_undecoratedName

Retrieves the undecorated name for a C++ decorated, or linkage, name.

IDiaSymbol::get_undecoratedNameEx

Extension of the get_undecoratedName method that retrieves the undecorated name based on the value of an extension field.

IDiaSymbol::get_unmodifiedTypeId

Retrieves the ID of the original (unmodified) type.

IDiaSymbol::get_upperBound

Retrieves the upper bound of a FORTRAN array dimension.

IDiaSymbol::get_upperBoundId

Retrieves the symbol identifier of the upper bound of a FORTRAN array dimension.

IDiaSymbol::get_value

Retrieves the value of a constant.

IDiaSymbol::get_virtual

Retrieves a flag indicating whether the function is virtual.

IDiaSymbol::get_virtualAddress

Retrieves the virtual address (VA) of the location.

IDiaSymbol::get_virtualBaseClass

Retrieves a flag indicating whether the user-defined data type is a virtual base class.

IDiaSymbol::get_virtualBaseDispIndex

Retrieves the index to the virtual base displacement table.

IDiaSymbol::get_virtualBaseOffset

Retrieves the offset in the virtual function table of a virtual function.

IDiaSymbol::get_virtualBasePointerOffset

Retrieves the offset of the virtual base pointer.

IDiaSymbol::get_virtualBaseTableType

Retrieves the type of a virtual base table pointer.

IDiaSymbol::get_virtualTableShape

Retrieves the symbol interface of the type of the virtual table for a user-defined type.

IDiaSymbol::get_virtualTableShapeId

Retrieves the virtual table shape identifier of the symbol.

IDiaSymbol::get_volatileType

Retrieves a flag indicating whether the user-defined data type is volatile.

Remarks

Notes for Callers

Obtain this interface by calling one of the following methods:

Example

This example shows how to display the local variables for a function at a given relative virtual address. It also shows how symbols of different types are related to each other.

Note

CDiaBSTR is a class that wraps a BSTR and automatically handles freeing the string when the instantiation goes out of scope.

void DumpLocalVars( DWORD rva, IDiaSession *pSession )
{
    CComPtr< IDiaSymbol > pBlock;
    if ( FAILED( psession->findSymbolByRVA( rva, SymTagBlock, &pBlock ) ) )
    {
        Fatal( "Failed to find symbols by RVA" );
    }
    CComPtr< IDiaSymbol > pscope;
    for ( ; pBlock != NULL; )
    {
        CComPtr< IDiaEnumSymbols > pEnum;
        // local data search
        if ( FAILED( pBlock->findChildren( SymTagNull, NULL, nsNone, &pEnum ) ) )
        {
            Fatal( "Local scope findChildren failed" );
        }
        CComPtr< IDiaSymbol > pSymbol;
        DWORD tag;
        DWORD celt;
        while ( pEnum != NULL &&
                SUCCEEDED( pEnum->Next( 1, &pSymbol, &celt ) ) &&
                celt == 1)
        {
            pSymbol->get_symTag( &tag );
            if ( tag == SymTagData )
            {
                CDiaBSTR name;
                DWORD    kind;
                pSymbol->get_name( &name );
                pSymbol->get_dataKind( &kind );
                if ( name != NULL )
                    wprintf_s( L"\t%s (%s)\n", name, szDataKinds[ kind ] );
            }
            else if ( tag == SymTagAnnotation )
            {
                CComPtr< IDiaEnumSymbols > pValues;
                // local data search
                wprintf_s( L"\tAnnotation:\n" );
                if ( FAILED( pSymbol->findChildren( SymTagNull, NULL, nsNone, &pValues ) ) )
                    Fatal( "Annotation findChildren failed" );
                pSymbol = NULL;
                while ( pValues != NULL &&
                        SUCCEEDED( pValues->Next( 1, &pSymbol, &celt ) ) &&
                        celt == 1 )
                {
                    CComVariant value;
                    if ( pSymbol->get_value( &value ) != S_OK )
                        Fatal( "No value for annotation data." );
                    wprintf_s( L"\t\t%ws\n", value.bstrVal );
                    pSymbol = NULL;
                }
            }
            pSymbol = NULL;
        }
        pBlock->get_symTag( &tag ); 
        if ( tag == SymTagFunction )    // stop when at function scope
            break;
        // move to lexical parent
        CComPtr< IDiaSymbol > pParent;
        if ( SUCCEEDED( pBlock->get_lexicalParent( &pParent ) )
            && pParent != NULL ) {
            pBlock = pParent;
        }
        else
        {
            Fatal( "Finding lexical parent failed." );
        }
    };
}

Requirements

Header: Dia2.h

Library: diaguids.lib

DLL: msdia80.dll

See Also

Reference

IDiaEnumSymbolsByAddr

IDiaEnumSymbols

IDiaSession

Class Hierarchy of Symbol Types

Compiland

Other Resources

Interfaces (Debug Interface Access SDK)

Symbols and Symbol Tags