Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always generate metadata for dynamic methods #72315

Merged
merged 1 commit into from
Jul 16, 2022

Conversation

davmason
Copy link
Member

Fixes #62977

This is an unintended side effect of #57069. As it stands now we won't generate metadata for dynamic modules unless a debugger is attached. Before that change we would bail from ReflectionModule::CaptureModuleMetaDataToMemory only if IsMetadataCaptureSuppressed() && !CORDebuggerAttached(), IsMetadataCaptureSuppressed() was only true in one case, when we were importing a COM type lib. But, when the import was done it would turn suppression off and we would generate the metadata then.

if (IsMetadataCaptureSuppressed() && !CORDebuggerAttached())
{
return;
}

After the change we always bail unconditionally if no debugger is attached, and there is no code to update it when a debugger attaches later.

if (!CORDebuggerAttached())
{
return;
}

The fix here is to delete the early out, since the COM typelib code was removed as part of the same effort. This will revert us to the previous behavior.

Originally posted by @davmason in #62977 (comment)

@davmason davmason added this to the 7.0.0 milestone Jul 16, 2022
@davmason davmason requested a review from a team July 16, 2022 11:03
@davmason davmason self-assigned this Jul 16, 2022
@ghost
Copy link

ghost commented Jul 16, 2022

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #62977

This is an unintended side effect of #57069. As it stands now we won't generate metadata for dynamic modules unless a debugger is attached. Before that change we would bail from ReflectionModule::CaptureModuleMetaDataToMemory only if IsMetadataCaptureSuppressed() && !CORDebuggerAttached(), IsMetadataCaptureSuppressed() was only true in one case, when we were importing a COM type lib. But, when the import was done it would turn suppression off and we would generate the metadata then.

if (IsMetadataCaptureSuppressed() && !CORDebuggerAttached())
{
return;
}

After the change we always bail unconditionally if no debugger is attached, and there is no code to update it when a debugger attaches later.

if (!CORDebuggerAttached())
{
return;
}

The fix here is to delete the early out, since the COM typelib code was removed as part of the same effort. This will revert us to the previous behavior.

Originally posted by @davmason in #62977 (comment)

Author: davmason
Assignees: davmason
Labels:

area-Diagnostics-coreclr

Milestone: 7.0.0

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this!

@jkotas jkotas merged commit 96cac6b into dotnet:main Jul 16, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants