-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Unify corerun's implementation of the native debugger check with the minipal for all platforms #109599
Conversation
…minipal for all platforms
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
#endif | ||
|
||
bool minipal_can_check_for_native_debugger(void) | ||
{ | ||
#if defined(MINIPAL_DEBUGGER_PRESENT_CHECK) |
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.
Looks like an always-true condition?
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.
It’s true for every platform we support, but if you build on an unsupported platform, we’ll hit the false case.
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.
IMO, just delete minipal_can_check_for_native_debugger
and add #else\n#error "Not yet implemented"
on line 47 to let the person/team consciously make a determination during the porting time (whether they want to ignore this feature by adding #elif defined(__someOS__) /* ignored */
or implement it as part of the port).
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.
@am11 I agree with these thoughts for most features, but the debugging scenario seems different. It doesn't need to exist for new platforms and not having a very basic "debugger supported check" means we then may need to add additional compile time checks in other places, which I think we'd like to avoid. The pattern here seems to be very simple, even if clunky, so new platform bring up can focus on "Hello, World" or just ignore debugging if desired.
Am I missing some mechanic of your proposal that would make this easier?
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.
@AaronRobinsonMSFT, without the additional API: main...am11:runtime:dedup-debugger-check, it wouldn't block HelloWorld during the port to new platform. To get by, the person will add an empty elif branch likely with a TODO (as they would need to adjust tons of other places) and obviously not use -d
or --debug
options with corerun
, as wait_for_debugger
is only called in that case.
No big deal, but that build-time error is the more prevalent pattern used in coreclr (I remembered hitting them in past adventures 😅).
Co-authored-by: Adeel Mujahid <[email protected]>
/ba-g debugger helix workitem deadletter (which we can't use known issues for today) |
Deduplicate the non-Windows path so new platforms only need to add support in one place.