-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update stepping through ExternalMethodFixup under the Debugger #108942
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
#include "array.h" | ||
#include "ecall.h" | ||
#include "virtualcallstub.h" | ||
#include "../debug/ee/debugger.h" | ||
|
||
#ifdef FEATURE_INTERPRETER | ||
#include "interpreter.h" | ||
|
@@ -3401,6 +3402,10 @@ EXTERN_C PCODE STDCALL ExternalMethodFixupWorker(TransitionBlock * pTransitionBl | |
pEMFrame->Pop(CURRENT_THREAD); // Pop the ExternalMethodFrame from the frame stack | ||
|
||
END_PRESERVE_LAST_ERROR; | ||
if (g_externalMethodFixupTraceActiveCount > 0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd suggest moving this code up to 3398. The INSTALL/UNINSTALL_xyz macros are creating try/catch regions to handle exceptions. I don't expect the debugger code to throw exceptions in any normal circumstance, but if there were some error (for example memory is corrupted causing an AV or stack space runs out) then its nice to treat those errors the same way as if they had happened anywhere else in the method body. Also the END_PRESERVE_LAST_ERROR macro is ensuring that the thread local GetLastError() value gets restored before this method returns. Its easier to put our debugger call above that point than to audit ensuring that nothing in the debugger call would ever cause it to change. |
||
{ | ||
g_pDebugger->ExternalMethodFixupNextStep(pCode); | ||
} | ||
|
||
return pCode; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ const char *GetTType( TraceType tt) | |
case TRACE_OTHER: return "TRACE_OTHER"; | ||
case TRACE_UNJITTED_METHOD: return "TRACE_UNJITTED_METHOD"; | ||
case TRACE_MULTICAST_DELEGATE_HELPER: return "TRACE_MULTICAST_DELEGATE_HELPER"; | ||
case TRACE_EXTERNAL_METHOD_FIXUP: return "TRACE_EXTERNAL_METHOD_FIXUP"; | ||
} | ||
return "TRACE_REALLY_WACKED"; | ||
} | ||
|
@@ -123,6 +124,10 @@ const CHAR * TraceDestination::DbgToString(SString & buffer) | |
pValue = "TRACE_MULTICAST_DELEGATE_HELPER"; | ||
break; | ||
|
||
case TRACE_EXTERNAL_METHOD_FIXUP: | ||
pValue = "TRACE_EXTERNAL_METHOD_FIXUP"; | ||
break; | ||
|
||
case TRACE_OTHER: | ||
pValue = "TRACE_OTHER"; | ||
break; | ||
|
@@ -1563,13 +1568,7 @@ BOOL RangeSectionStubManager::DoTraceStub(PCODE stubStartAddress, TraceDestinati | |
#ifdef DACCESS_COMPILE | ||
DacNotImpl(); | ||
#else | ||
#if defined(TARGET_ARM64) && defined(__APPLE__) | ||
// On ARM64 Mac, we cannot put a breakpoint inside of ExternalMethodFixupPatchLabel | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Delete all occurrences of |
||
LOG((LF_CORDB, LL_INFO10000, "RSM::DoTraceStub: Skipping on arm64-macOS\n")); | ||
return FALSE; | ||
#else | ||
trace->InitForManagerPush(GetEEFuncEntryPoint(ExternalMethodFixupPatchLabel), this); | ||
#endif //defined(TARGET_ARM64) && defined(__APPLE__) | ||
trace->InitForExternalMethodFixup(); | ||
#endif | ||
return TRUE; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: the same missing space is in the message above too