Skip to content

Always generate metadata for dynamic methods - #72315

Merged
jkotas merged 1 commit into
dotnet:mainfrom
davmason:debug_metadata
Jul 16, 2022
Merged

jkotas merged 1 commit into
dotnet:mainfrom
davmason:debug_metadata

Conversation

@davmason

Copy link
Copy Markdown
Contributor

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

ghost commented Jul 16, 2022

Copy link
Copy Markdown

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

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

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

Development

Successfully merging this pull request may close these issues.

[DAC][DBI] ICorDebugModule::GetMetaDataInterface fails in net6.0 for "Anonymously Hosted DynamicMethods Assembly" in unit test project.

2 participants