Skip to content

Commit

Permalink
Remove unused code in debugger patch skip logic (dotnet#91230)
Browse files Browse the repository at this point in the history
  • Loading branch information
tommcdon authored Aug 29, 2023
1 parent b9b51d3 commit 8a2cc6d
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions src/coreclr/debug/ee/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4724,43 +4724,6 @@ TP_RESULT DebuggerPatchSkip::TriggerExceptionHook(Thread *thread, CONTEXT * cont

if (IsSingleStep(exception->ExceptionCode))
{
#ifndef TARGET_UNIX
// Check if the current IP is anywhere near the exception dispatcher logic.
// If it is, ignore the exception, as the real exception is coming next.
static FARPROC pExcepDispProc = NULL;

if (!pExcepDispProc)
{
HMODULE hNtDll = WszGetModuleHandle(W("ntdll.dll"));

if (hNtDll != NULL)
{
pExcepDispProc = GetProcAddress(hNtDll, "KiUserExceptionDispatcher");

if (!pExcepDispProc)
pExcepDispProc = (FARPROC)(size_t)(-1);
}
else
pExcepDispProc = (FARPROC)(size_t)(-1);
}

_ASSERTE(pExcepDispProc != NULL);

if ((size_t)pExcepDispProc != (size_t)(-1))
{
LPVOID pExcepDispEntryPoint = pExcepDispProc;

if ((size_t)GetIP(context) > (size_t)pExcepDispEntryPoint &&
(size_t)GetIP(context) <= ((size_t)pExcepDispEntryPoint + MAX_INSTRUCTION_LENGTH * 2 + 1))
{
LOG((LF_CORDB, LL_INFO10000,
"Bypass instruction not redirected. Landed in exception dispatcher.\n"));

return (TPR_IGNORE_AND_STOP);
}
}
#endif // TARGET_UNIX

// If the IP is close to the skip patch start, or if we were skipping over a call, then assume the IP needs
// adjusting.
if (m_instrAttrib.m_fIsCall ||
Expand Down

0 comments on commit 8a2cc6d

Please sign in to comment.