Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,16 +297,23 @@ HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::UnwindStackWalkFrame(StackWalkHan
}
else if (pIter->GetFrameState() == StackFrameIterator::SFITER_FRAMELESS_METHOD)
{
// Skip the new exception handling managed code, the debugger clients are not supposed to see them
MethodDesc *pMD = pIter->m_crawl.GetFunction();
Comment thread
jkotas marked this conversation as resolved.
Comment thread
jkotas marked this conversation as resolved.

Comment thread
jkotas marked this conversation as resolved.
Outdated
// Skip the exception handling managed code, the debugger clients are not supposed to see them
// EH.DispatchEx, EH.RhThrowEx, EH.RhThrowHwEx, ExceptionServices.InternalCalls.SfiInit, ExceptionServices.InternalCalls.SfiNext
// and System.Runtime.StackFrameIterator.*
if (pMD->GetMethodTable() == g_pEHClass || pMD->GetMethodTable() == g_pExceptionServicesInternalCallsClass || pMD->GetMethodTable() == g_pStackFrameIteratorClass)
Comment thread
jkotas marked this conversation as resolved.
Outdated
{
continue;
}

// Skip the runtime helper that invokes the main program entrypoint, the debuggers do not want to see it.
// Environment.CallEntryPoint
if (pMD == g_pEnvironmentCallEntryPointMethodDesc)
{
continue;
}

fIsAtEndOfStack = FALSE;
}
else
Expand Down Expand Up @@ -421,6 +428,11 @@ HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetStackWalkCurrentFrameInfo(Stac
{
ftResult = kManagedExceptionHandlingCodeFrame;
}
// Environment.CallEntryPoint
else if (pMD == g_pEnvironmentCallEntryPointMethodDesc)
{
ftResult = kRuntimeEntryPointFrame;
}
else
{
ftResult = kManagedStackFrame;
Expand Down
5 changes: 5 additions & 0 deletions src/coreclr/debug/di/rsstackwalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,11 @@ HRESULT CordbStackWalk::GetFrameWorker(ICorDebugFrame ** ppFrame)
STRESS_LOG1(LF_CORDB, LL_INFO1000, "CSW::GFW - managed exception handling code frame (%p)", this);
return S_FALSE;
}
else if (ft == IDacDbiInterface::kRuntimeEntryPointFrame)
{
STRESS_LOG1(LF_CORDB, LL_INFO1000, "CSW::GFW - runtime entry point frame (%p)", this);
return S_FALSE;
}
else if (ft == IDacDbiInterface::kExplicitFrame)
{
STRESS_LOG1(LF_CORDB, LL_INFO1000, "CSW::GFW - explicit frame (%p)", this);
Expand Down
10 changes: 10 additions & 0 deletions src/coreclr/debug/ee/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6769,12 +6769,22 @@ bool DebuggerStepper::IsInterestingFrame(FrameInfo * pFrame)

// Ignore managed exception handling frames
if (pFrame->md != NULL)
Comment thread
jkotas marked this conversation as resolved.
Outdated
{
Comment thread
jkotas marked this conversation as resolved.
Outdated
if (pFrame->md != NULL)
{
MethodTable *pMT = pFrame->md->GetMethodTable();
Comment thread
jkotas marked this conversation as resolved.

// Ignore managed exception handling frames
if ((pMT == g_pEHClass) || (pMT == g_pExceptionServicesInternalCallsClass))
{
return false;
}

// Ignore the runtime helper that invokes the main program entrypoint
if (pFrame->md == g_pEnvironmentCallEntryPointMethodDesc)
{
return false;
}
}

return true;
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/debug/inc/dacdbiinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,7 @@ IDacDbiInterface : public IUnknown
kNativeStackFrame,
kNativeRuntimeUnwindableStackFrame,
kManagedExceptionHandlingCodeFrame,
kRuntimeEntryPointFrame,
kAtEndOfStack,
} FrameType;

Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/inc/dacvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ DEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pEHClass, ::g_pEHClass)
DEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pExceptionServicesInternalCallsClass, ::g_pExceptionServicesInternalCallsClass)
DEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pStackFrameIteratorClass, ::g_pStackFrameIteratorClass)

DEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pEnvironmentCallEntryPointMethodDesc, ::g_pEnvironmentCallEntryPointMethodDesc)

DEFINE_DACVAR(PTR_SString, SString__s_Empty, SString::s_Empty)

DEFINE_DACVAR(INT32, ArrayBase__s_arrayBoundsZero, ArrayBase::s_arrayBoundsZero)
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/vm/assembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1165,8 +1165,6 @@ struct Param
bool captureException;
} param;

MethodDesc* g_pEnvironmentCallEntryPointMethodDesc = nullptr;

#if defined(TARGET_BROWSER)
extern "C" void SystemJS_ResolveMainPromise(int exitCode);
#endif // TARGET_BROWSER
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/vm/debugdebugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@

#ifndef DACCESS_COMPILE

extern MethodDesc* g_pEnvironmentCallEntryPointMethodDesc;

//
// Notes:
// If a managed debugger is attached, this should send the managed UserBreak event.
Expand Down
4 changes: 1 addition & 3 deletions src/coreclr/vm/eepolicy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#include "eventtrace.h"
#undef ExitProcess

extern MethodDesc* g_pEnvironmentCallEntryPointMethodDesc;

void SafeExitProcess(UINT exitCode, ShutdownCompleteAction sca = SCA_ExitProcessWhenShutdownComplete)
{
STRESS_LOG2(LF_SYNC, LL_INFO10, "SafeExitProcess: exitCode = %d sca = %d\n", exitCode, sca);
Expand Down Expand Up @@ -180,7 +178,7 @@ class CallStackLogger

MethodDesc* pMD = pCF->GetFunction();

// Skip Environment.CallEntryPoint so it doesn't appear in vanilla
// Skip Environment.CallEntryPoint so it doesn't appear in
// unhandled exception experiences.
if (pMD != nullptr && pMD == g_pEnvironmentCallEntryPointMethodDesc)
{
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/vm/exceptionhandling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "exinfo.h"
#include "configuration.h"

extern MethodDesc* g_pEnvironmentCallEntryPointMethodDesc;
extern MethodDesc* g_pThreadStartCallbackMethodDesc;
extern MethodDesc* g_pGCRunFinalizersMethodDesc;

Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/vm/vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ GPTR_IMPL(MethodTable, g_pEHClass);
GPTR_IMPL(MethodTable, g_pExceptionServicesInternalCallsClass);
GPTR_IMPL(MethodTable, g_pStackFrameIteratorClass);

GPTR_IMPL(MethodDesc, g_pEnvironmentCallEntryPointMethodDesc);

GVAL_IMPL_INIT(PTR_WSTR, g_EntryAssemblyPath, NULL);

#ifndef DACCESS_COMPILE
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/vm/vars.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ GPTR_DECL(MethodTable, g_pEHClass);
GPTR_DECL(MethodTable, g_pExceptionServicesInternalCallsClass);
GPTR_DECL(MethodTable, g_pStackFrameIteratorClass);

GPTR_DECL(MethodDesc, g_pEnvironmentCallEntryPointMethodDesc);

// Full path to the managed entry assembly - stored for ease of identifying the entry asssembly for diagnostics
GVAL_DECL(PTR_WSTR, g_EntryAssemblyPath);

Expand Down