Repository: dotnet/runtime
File: src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp (C++)

Code before:

        pFrameData->eType = DebuggerIPCE_STRData::cMethodFrame;

        SetDebuggerREGDISPLAYFromREGDISPLAY(&(pFrameData->rd), pCF->GetRegisterSet());

        GetStackWalkCurrentContext(pIter, &(pFrameData->ctx));

        //
        // initialize the fields in DebuggerIPCE_STRData::v
        //

        // These fields will be filled in later.  We don't have the sequence point mapping information here.
        pFrameData->v.ILOffset = (SIZE_T)(-1);
        pFrameData->v.mapping  = MAPPING_NO_INFO;

        // Check if this is a vararg method by getting the managed calling convention from the signature.
        // Strictly speaking, we can do this in CordbJITILFrame::Init(), but it's just easier and more
        // efficiently to do it here.  CordbJITILFrame::Init() will initialize the other vararg-related
        // fields.  We don't have the native var info here to fully initialize everything.
        pFrameData->v.fVarArgs = (pMD->IsVarArg() == TRUE);

        // Check if this is a NoMetadata method or if the method should be hidden.
        // These methods should not be visible in the debugger both for convenience and 
        // because they don't have backing metadata. For more information see comments in
        // MethodDesc::IsNoMetadata and MethodDesc::IsDiagnosticsHidden.
        pFrameData->v.fNoMetadata = (pMD->IsNoMetadata() == TRUE) || pMD->IsDiagnosticsHidden();

        pFrameData->v.taAmbientESP = pCF->GetAmbientSPFromCrawlFrame();
        if (pMD->IsSharedByGenericInstantiations())
        {
            // This method has a generic type token which is required to figure out the exact instantiation
            // of the method.  CrawlFrame::GetExactGenericArgsToken() can't always successfully retrieve
            // the token because the JIT doesn't generate the required information all the time.  As such,
            // we need to save the variable index of the generic type token in order to do the look up later.
            ALLOW_DATATARGET_MISSING_MEMORY(
                pFrameData->v.exactGenericArgsToken = (GENERICS_TYPE_TOKEN)(dac_cast<TADDR>(pCF->GetExactGenericArgsToken()));
            );

            if (pMD->AcquiresInstMethodTableFromThis())
            {
                // The generic type token is the "this" object.
                pFrameData->v.dwExactGenericArgsTokenIndex = 0;
            }
            else
            {
                // The generic type token is one of the secret arguments.
                pFrameData->v.dwExactGenericArgsTokenIndex = (DWORD)ICorDebugInfo::TYPECTXT_ILNUM;
            }
        }
        else
        {

Review comment (suggestion):
```suggestion
        pFrameData->v.fNoMetadata = pMD->IsNoMetadata() || pMD->IsDiagnosticsHidden();
```

Code after:

        pFrameData->eType = DebuggerIPCE_STRData::cMethodFrame;

        SetDebuggerREGDISPLAYFromREGDISPLAY(&(pFrameData->rd), pCF->GetRegisterSet());

        GetStackWalkCurrentContext(pIter, &(pFrameData->ctx));

        //
        // initialize the fields in DebuggerIPCE_STRData::v
        //

        // These fields will be filled in later.  We don't have the sequence point mapping information here.
        pFrameData->v.ILOffset = (SIZE_T)(-1);
        pFrameData->v.mapping  = MAPPING_NO_INFO;

        // Check if this is a vararg method by getting the managed calling convention from the signature.
        // Strictly speaking, we can do this in CordbJITILFrame::Init(), but it's just easier and more
        // efficiently to do it here.  CordbJITILFrame::Init() will initialize the other vararg-related
        // fields.  We don't have the native var info here to fully initialize everything.
        pFrameData->v.fVarArgs = pMD->IsVarArg();

        // Check if this is a NoMetadata method or if the method should be hidden.
        // These methods should not be visible in the debugger both for convenience and 
        // because they don't have backing metadata. For more information see comments in
        // MethodDesc::IsNoMetadata and MethodDesc::IsDiagnosticsHidden.
        pFrameData->v.fNoMetadata = pMD->IsNoMetadata() || pMD->IsDiagnosticsHidden();

        pFrameData->v.taAmbientESP = pCF->GetAmbientSPFromCrawlFrame();
        if (pMD->IsSharedByGenericInstantiations())
        {
            // This method has a generic type token which is required to figure out the exact instantiation
            // of the method.  CrawlFrame::GetExactGenericArgsToken() can't always successfully retrieve
            // the token because the JIT doesn't generate the required information all the time.  As such,
            // we need to save the variable index of the generic type token in order to do the look up later.
            ALLOW_DATATARGET_MISSING_MEMORY(
                pFrameData->v.exactGenericArgsToken = (GENERICS_TYPE_TOKEN)(dac_cast<TADDR>(pCF->GetExactGenericArgsToken()));
            );

            if (pMD->AcquiresInstMethodTableFromThis())
            {
                // The generic type token is the "this" object.
                pFrameData->v.dwExactGenericArgsTokenIndex = 0;
            }
            else
            {
                // The generic type token is one of the secret arguments.
                pFrameData->v.dwExactGenericArgsTokenIndex = (DWORD)ICorDebugInfo::TYPECTXT_ILNUM;
            }
        }
        else
        {