Skip to content

Commit 8671908

Browse files
authored
add support for unwinding function fragments in the dac (#53765)
1 parent d52f925 commit 8671908

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/coreclr/vm/codeman.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4078,6 +4078,23 @@ void GetUnmanagedStackWalkInfo(IN ULONG64 ControlPc,
40784078
else
40794079
{
40804080
_ASSERTE(pFuncEntry);
4081+
#ifdef _TARGET_AMD64_
4082+
// On amd64, match RtlLookupFunctionEntry behavior by resolving indirect function entries
4083+
// back to the associated owning function entry.
4084+
if ((functionEntry.UnwindData & RUNTIME_FUNCTION_INDIRECT) != 0)
4085+
{
4086+
DWORD dwRvaOfOwningFunctionEntry = (functionEntry.UnwindData & ~RUNTIME_FUNCTION_INDIRECT);
4087+
taFuncEntry = peDecoder.GetRvaData(dwRvaOfOwningFunctionEntry);
4088+
hr = DacReadAll(taFuncEntry, &functionEntry, sizeof(functionEntry), false);
4089+
if (FAILED(hr))
4090+
{
4091+
return;
4092+
}
4093+
4094+
_ASSERTE((functionEntry.UnwindData & RUNTIME_FUNCTION_INDIRECT) == 0);
4095+
}
4096+
#endif // _TARGET_AMD64_
4097+
40814098
*pFuncEntry = (UINT_PTR)(T_RUNTIME_FUNCTION*)PTR_RUNTIME_FUNCTION(taFuncEntry);
40824099
break;
40834100
}

0 commit comments

Comments
 (0)