Skip to content

Delete SUPPORT_LOCAL_DEBUGGING ifdef - #134664

Open
jkotas with Copilot wants to merge 1 commit into
mainfrom
copilot/delete-support-local-debugging-ifdef
Open

jkotas with Copilot wants to merge 1 commit into
mainfrom
copilot/delete-support-local-debugging-ifdef

Conversation

Copilot AI commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

SUPPORT_LOCAL_DEBUGGING in debug/di/cordb.cpp was used only by ARM's out-of-line DbiGetThreadContext/DbiSetThreadContext. ARM32 is supported only on Unix, where the define was 0, so both functions always asserted and returned FALSE.

  • debug/di/cordb.cpp
    • Removes the SUPPORT_LOCAL_DEBUGGING define.
    • Removes the ARM-only DbiGetThreadContext/DbiSetThreadContext implementations.
  • debug/di/stdafx.h
    • Removes the TARGET_ARM split.
    • ARM now uses the same macros as every other platform:
#define DbiGetThreadContext(hThread, lpContext) ::GetThreadContext(hThread, (CONTEXT*)(lpContext))
#define DbiSetThreadContext(hThread, lpContext) ::SetThreadContext(hThread, (CONTEXT*)(lpContext))

On ARM, callers now reach the PAL GetThreadContext/SetThreadContext, the same as other Unix architectures, instead of an assert-and-fail stub. Most callers are in FEATURE_INTEROP_DEBUGGING paths, which are Windows-only.

Note

This PR was generated by GitHub Copilot.

Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@jkotas
jkotas marked this pull request as ready for review September 25, 2026 17:08
Copilot AI lite review requested due to automatic review settings September 25, 2026 17:08
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The ARM-specific context layout and alignment safeguards need to be retained or proven unnecessary.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

This PR removes obsolete ARM-specific debugging stubs and unifies thread-context macros across platforms.

Changes:

  • Removes SUPPORT_LOCAL_DEBUGGING and ARM-only implementations.
  • Uses shared GetThreadContext/SetThreadContext macros for ARM.
File Summary
src/​coreclr/​debug/​di/​stdafx.h Unifies context macros; a critical ARM layout and alignment concern remains.
src/​coreclr/​debug/​di/​cordb.cpp Removes obsolete ARM implementations and configuration.

Comment on lines 47 to 48
#define DbiGetThreadContext(hThread, lpContext) ::GetThreadContext(hThread, (CONTEXT*)(lpContext))
#define DbiSetThreadContext(hThread, lpContext) ::SetThreadContext(hThread, (CONTEXT*)(lpContext))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path is only reachable with local debugging that cannot be cross compiled by design.

#endif // FEATURE_DBGIPC_TRANSPORT_DI

#if defined(TARGET_UNIX) || defined(__ANDROID__)
// Local (in-process) debugging is not supported for UNIX and Android.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ancient left-over that is causing confusion

Context: dotnet/docs#56220 (comment)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants