Make IsSSFlagEnabled signature consistent across all architectures#125678
Closed
Make IsSSFlagEnabled signature consistent across all architectures#125678
Conversation
Co-authored-by: davidwrighton <10779849+davidwrighton@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
davidwrighton
March 17, 2026 20:42
View session
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Member
|
Sigh. This doesn't actually look better. |
This was referenced Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IsSSFlagEnabledhad inconsistent signatures across architectures:inline bool IsSSFlagEnabled(DT_CONTEXT * context)— 1 parameter (context only)arm_primitives.h(two overloads)bool IsSSFlagEnabled(DT_CONTEXT *pCtx, Thread *pThread)— 2 parametersThis forced call sites in
debugger.cppto use awkwardARM_ARG(pThread) ARM64_ARG(pThread) RISCV64_ARG(pThread) LOONGARCH64_ARG(pThread)macros to conditionally pass the thread.Changes
All architectures now use a uniform signature:
bool IsSSFlagEnabled(DT_CONTEXT *pCtx, Thread *pThread). Architectures that don't need theThread*parameter (AMD64, i386, ARM64 withoutFEATURE_EMULATE_SINGLESTEP) simply ignore it.debug/inc/amd64/primitives.handdebug/inc/i386/primitives.h: Addedclass Thread;forward declaration andThread* /* pThread */ = nullptrparameter to the inline function. Consistent with the same pattern already used inarm/primitives.h,loongarch64/primitives.h, etc.debug/inc/arm64/primitives.h: Removed the 1-paramIsSSFlagEnabledinline. The 2-param declaration from the already-includedarm_primitives.hnow serves as the sole declaration.debug/ee/arm64/primitives.cpp: In the!FEATURE_EMULATE_SINGLESTEPblock, replacedreturn IsSSFlagEnabled(pContext)(which called the now-removed 1-param inline) with the CPSR check directly.debug/di/arm64/primitives.cpp: Added a!FEATURE_EMULATE_SINGLESTEPimplementation ofIsSSFlagEnabledfor Windows ARM64 DBI (which hasFEATURE_INTEROP_DEBUGGINGbut notFEATURE_EMULATE_SINGLESTEP).debug/di/rsthread.cpp: Updated 5 call sites to passnullptras the thread.debug/di/process.cpp: Updated 2 call sites to passnullptras the thread.debug/ee/debugger.cpp: Simplified the macro-based call to always passpThreaddirectly.Note
SetSSFlagandUnsetSSFlaghave the same signature inconsistency. That cleanup can be done as a follow-up.