Skip to content

Commit

Permalink
add support for unwinding function fragments in the dac (#53765)
Browse files Browse the repository at this point in the history
  • Loading branch information
davmason authored Jun 8, 2021
1 parent d52f925 commit 8671908
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/coreclr/vm/codeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4078,6 +4078,23 @@ void GetUnmanagedStackWalkInfo(IN ULONG64 ControlPc,
else
{
_ASSERTE(pFuncEntry);
#ifdef _TARGET_AMD64_
// On amd64, match RtlLookupFunctionEntry behavior by resolving indirect function entries
// back to the associated owning function entry.
if ((functionEntry.UnwindData & RUNTIME_FUNCTION_INDIRECT) != 0)
{
DWORD dwRvaOfOwningFunctionEntry = (functionEntry.UnwindData & ~RUNTIME_FUNCTION_INDIRECT);
taFuncEntry = peDecoder.GetRvaData(dwRvaOfOwningFunctionEntry);
hr = DacReadAll(taFuncEntry, &functionEntry, sizeof(functionEntry), false);
if (FAILED(hr))
{
return;
}

_ASSERTE((functionEntry.UnwindData & RUNTIME_FUNCTION_INDIRECT) == 0);
}
#endif // _TARGET_AMD64_

*pFuncEntry = (UINT_PTR)(T_RUNTIME_FUNCTION*)PTR_RUNTIME_FUNCTION(taFuncEntry);
break;
}
Expand Down

0 comments on commit 8671908

Please sign in to comment.