Skip to content

Pass down DJI and MethodDesc to avoid unnecessary PtrHashMap lookup#130539

Open
hoyosjs wants to merge 1 commit into
dotnet:mainfrom
hoyosjs:juhoyosa/port-pr-126247
Open

Pass down DJI and MethodDesc to avoid unnecessary PtrHashMap lookup#130539
hoyosjs wants to merge 1 commit into
dotnet:mainfrom
hoyosjs:juhoyosa/port-pr-126247

Conversation

@hoyosjs

@hoyosjs hoyosjs commented Jul 11, 2026

Copy link
Copy Markdown
Member

Description

This ports the fix from #126247 to main. DebuggerController::BindPatch already has the DebuggerJitInfo and MethodDesc needed by CodeRegionInfo::GetCodeRegionInfo, so this change passes them through instead of forcing the fallback lookup path.

That keeps main aligned with the servicing fix and avoids an unnecessary PtrHashMap lookup while binding patches in src/coreclr/debug/ee/controller.cpp.

Note

This PR description was generated with GitHub Copilot.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates CoreCLR’s debugger patch binding path to pass already-available DebuggerJitInfo* and MethodDesc* into CodeRegionInfo::GetCodeRegionInfo when computing the target patch address, avoiding the fallback path that derives region info from the start address alone.

Changes:

  • In DebuggerController::BindPatch, call CodeRegionInfo::GetCodeRegionInfo(info, pMD, startAddr) instead of GetCodeRegionInfo(NULL, NULL, startAddr) so GetCodeRegionInfo can immediately return cached region info when info->m_addrOfCode is present.
  • Keeps the binding logic consistent with GetCodeRegionInfo’s contract (when addr is provided, it asserts it matches GetFunctionAddress(md)), since startAddr here is sourced from DebuggerJitInfo::m_addrOfCode / GetCodeForInterpreterOrJitted().

@hoyosjs hoyosjs linked an issue Jul 11, 2026 that may be closed by this pull request
@hoyosjs hoyosjs enabled auto-merge (squash) July 11, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Debugger hangs due to runtime deadlock.

3 participants