Share via


IDebugComPlusSymbolProvider2::FunctionHasLineInfo

Determines if the specified method has line information.

HRESULT FunctionHasLineInfo(
   IDebugAddress* pAddress
);
int FunctionHasLineInfo(
   IDebugAddress pAddress
);

Parameters

  • pAddress
    [in] The debug address that is represented by an IDebugAddress interface. This address must be a METHOD_ADDRESS.

Return Value

If successful, returns S_OK; otherwise, returns S_FALSE.

Example

The following example shows how to implement this method for a CDebugSymbolProvider object that exposes the IDebugComPlusSymbolProvider2 interface.

HRESULT CDebugSymbolProvider::FunctionHasLineInfo(
    IDebugAddress* pAddress
)
{
    HRESULT hr = S_OK;
    CDEBUG_ADDRESS address;
    CComPtr<CModule> pModule;

    METHOD_ENTRY( CDebugSymbolProvider::LoadSymbol );

    IfFalseGo( pAddress, E_INVALIDARG );

    IfFailGo( pAddress->GetAddress( &address ) );

    ASSERT(address.addr.dwKind == ADDRESS_KIND_METADATA_METHOD);
    IfFalseGo( address.addr.dwKind == ADDRESS_KIND_METADATA_METHOD, S_FALSE );

    IfFailGo( GetModule( address.GetModule(), &pModule) );

    if (!pModule->FunctionHasLineInfo( address.addr.addr.addrMethod.tokMethod,
                                       address.addr.addr.addrMethod.dwVersion))
    {

        // S_FALSE indicates this method does not have line info

        hr = S_FALSE;
    }


Error:

    METHOD_EXIT( CDebugSymbolProvider::LoadSymbol, hr );

    return hr;
}

See Also

Reference

IDebugComPlusSymbolProvider2