Repository: dotnet/runtime
File: src/coreclr/debug/ee/frameinfo.cpp (C++)

Code before:
                LOG((LF_CORDB, LL_INFO100000, "DWSP: Stopping to skip funclet at 0x%p.\n", d->fpParent.GetSPValue()));

                d->fpParent = LEAF_MOST_FRAME;
                d->fpParent = CheckForParentFP(d->fpParent, pCF, d->info.IsNonFilterFuncletFrame());
            }
        }
    }

    d->info.frame = frame;
    d->info.ambientSP = (TADDR)NULL;

    // Record the appdomain that the thread was in when it
    // was running code for this frame.
    d->info.currentAppDomain = AppDomain::GetCurrentDomain();

    //  Grab all the info from CrawlFrame that we need to
    //  check for "Am I in an exception code blob?" now.

    // We are still searching for the parent of the last funclet we encounter.
    if (d->fpParent != LEAF_MOST_FRAME)
    {
        // We do nothing here.
        LOG((LF_CORDB, LL_INFO100000, "DWSP: Skipping to parent method frame at 0x%p.\n", d->fpParent.GetSPValue()));
    }
    else
    // Hide frameless MethodDescs that are marked as hidden from diagnostics.
    if ((md != NULL) && md->IsDiagnosticsHidden() && pCF->IsFrameless())
    {
        if (md->IsILStub())
        {
            // We ignore most IL stubs with no frames in our stackwalking. As exceptions
            // we will always report multicast stubs and the tailcall call target stubs
            // since we treat them specially in the debugger.
            _ASSERTE(md->IsDynamicMethod());
            DynamicMethodDesc* dMD = md->AsDynamicMethodDesc();
            use |= dMD->IsMulticastStub();
            use |= dMD->GetILStubType() == DynamicMethodDesc::StubTailCallCallTarget;
        }

        if (use)
        {
            d->info.managed = true;
            d->info.internal = false;
        }
        else
        {
            LOG((LF_CORDB, LL_INFO100000, "DWSP: Skip IsDiagnosticsHidden method.\n"));
        }
    }
    else
    // For frames w/o method data, send them as an internal stub frame.

Review comment (bug):
```suggestion
    // Most frameless IsDebuggerHidden methods can be eagerly filtered from the stacktrace so
    // that the remaining debugger code doesn't have to reason about them. There are a few
    // special cases below where the runtime debugger code does need to reason about them and
    // then we filter them out at a later stage.
```

Code after:
                LOG((LF_CORDB, LL_INFO100000, "DWSP: Stopping to skip funclet at 0x%p.\n", d->fpParent.GetSPValue()));

                d->fpParent = LEAF_MOST_FRAME;
                d->fpParent = CheckForParentFP(d->fpParent, pCF, d->info.IsNonFilterFuncletFrame());
            }
        }
    }

    d->info.frame = frame;
    d->info.ambientSP = (TADDR)NULL;

    // Record the appdomain that the thread was in when it
    // was running code for this frame.
    d->info.currentAppDomain = AppDomain::GetCurrentDomain();

    //  Grab all the info from CrawlFrame that we need to
    //  check for "Am I in an exception code blob?" now.

    // We are still searching for the parent of the last funclet we encounter.
    if (d->fpParent != LEAF_MOST_FRAME)
    {
        // We do nothing here.
        LOG((LF_CORDB, LL_INFO100000, "DWSP: Skipping to parent method frame at 0x%p.\n", d->fpParent.GetSPValue()));
    }
    else
    // We ignore most IL stubs with no frames in our stackwalking. As exceptions
    // we will always report multicast stubs and the tailcall call target stubs
    // since we treat them specially in the debugger.
    if ((md != NULL) && md->IsILStub() && pCF->IsFrameless())
    {
        _ASSERTE(md->IsDynamicMethod());
        DynamicMethodDesc* dMD = md->AsDynamicMethodDesc();
        use |= dMD->IsMulticastStub();
        use |= dMD->GetILStubType() == DynamicMethodDesc::StubTailCallCallTarget;

        if (use)
        {
            d->info.managed = true;
            d->info.internal = false;
        }
        else
        {
            LOG((LF_CORDB, LL_INFO100000, "DWSP: Skip frameless IL stub.\n"));
        }
    }
    else
    // For frames w/o method data, send them as an internal stub frame.
    if ((md != NULL) && md->IsDynamicMethod())
    {
        // Only Send the frame if "InternalFrames" are requested.
        // Else completely ignore it.