-
Notifications
You must be signed in to change notification settings - Fork 206
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
Add Internal.Console #112
Add Internal.Console #112
Conversation
This is the same Internal.Console that CoreCLR has, but extended with Unix support. Is there any appetite to have this, potentially in the shared partition? As I was debugging the timer/threadpool issue on Linux, I quickly found out that due to timing, printf debugging was the only feasible way to find out what's going on.
{ | ||
#if TARGET_WINDOWS | ||
private static readonly SafeFileHandle _outputHandle = | ||
new SafeFileHandle(Interop.Kernel32.GetStdHandle(Interop.Kernel32.HandleTypes.STD_OUTPUT_HANDLE), ownsHandle: false); |
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 may be nice to avoid the SafeHandle, and use WriteFile_IntPtr.cs
to print the message instead.
public static class Console | ||
{ | ||
#if TARGET_WINDOWS | ||
private static readonly SafeFileHandle _outputHandle = |
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: Statics should have s_
prefix
@@ -23,3 +25,12 @@ int32_t SystemNative_SNPrintF(char* string, int32_t size, const char* format, .. | |||
va_end(arguments); | |||
return result; | |||
} | |||
|
|||
int32_t SystemNative_PrintF(const char* format, ...) |
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.
I think it would be better to expose this as SystemNative_Log
that just prints string. There is an existing iOS-specific SystemNative_Log
.
I think so. |
Superseded by dotnet/runtime#42983. |
This is the same Internal.Console that CoreCLR has, but extended with Unix support.
Is there any appetite to have this, potentially in the shared partition?
As I was debugging the timer/threadpool issue on Linux, I quickly found out that due to timing, printf debugging was the only feasible way to find out what's going on.