Skip to content
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

Closed

Conversation

MichalStrehovsky
Copy link
Member

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.

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.
@MichalStrehovsky MichalStrehovsky added the area-NativeAOT-coreclr .NET runtime optimized for ahead of time compilation label Sep 18, 2020
{
#if TARGET_WINDOWS
private static readonly SafeFileHandle _outputHandle =
new SafeFileHandle(Interop.Kernel32.GetStdHandle(Interop.Kernel32.HandleTypes.STD_OUTPUT_HANDLE), ownsHandle: false);
Copy link
Member

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 =
Copy link
Member

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, ...)
Copy link
Member

@jkotas jkotas Sep 18, 2020

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.

@jkotas
Copy link
Member

jkotas commented Sep 18, 2020

Is there any appetite to have this, potentially in the shared partition?

I think so.

@MichalStrehovsky
Copy link
Member Author

Superseded by dotnet/runtime#42983.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NativeAOT-coreclr .NET runtime optimized for ahead of time compilation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants