Skip to content

Add Process.debugger_present? for Windows and Linux#16248

Merged
straight-shoota merged 2 commits intocrystal-lang:masterfrom
HertzDevil:feature/debugger-present
Oct 24, 2025
Merged

Add Process.debugger_present? for Windows and Linux#16248
straight-shoota merged 2 commits intocrystal-lang:masterfrom
HertzDevil:feature/debugger-present

Conversation

@HertzDevil
Copy link
Contributor

Resolves part of #15137.

Comment on lines +113 to +119
# Returns whether a debugger is attached to the current process.
#
# Always returns `false` if the system has no means of determining the
# presence of a debugger.
def self.debugger_present? : Bool
Crystal::System::Process.debugger_present?
end
Copy link
Member

@straight-shoota straight-shoota Oct 22, 2025

Choose a reason for hiding this comment

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

thought: As long as this method is not fully portable, maybe we should not expose it in the public API? Or at least add @[Experimental].

It would also be helpful to clarify which systems are expected to give an actual answer. It we make it nodoc for now, this information can be added later once we fill the TODOs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO support on all Tier 1 platforms + Windows is sufficient for removing @[Experimental], otherwise it would take forever to stabilize any kind of system API in the standard library (consider our current progress on WebAssembly for example).

@straight-shoota straight-shoota added this to the 1.19.0 milestone Oct 22, 2025
@straight-shoota straight-shoota merged commit d6dbe7d into crystal-lang:master Oct 24, 2025
39 checks passed
@HertzDevil HertzDevil deleted the feature/debugger-present branch October 24, 2025 09:47
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.

2 participants