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

Integrate selected changes from nativeaot branch #53185

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Unify Environment.StackTrace
  • Loading branch information
jkotas committed May 25, 2021
commit 89381757069abf79ac0574c38821d92817cbd37d
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ public static string[] GetCommandLineArgs()
// Used by VM
internal static string? GetResourceStringLocal(string key) => SR.GetResourceString(key);

public static string StackTrace
{
[MethodImpl(MethodImplOptions.NoInlining)] // Prevent inlining from affecting where the stacktrace starts
get => new StackTrace(true).ToString(System.Diagnostics.StackTrace.TraceFormat.Normal);
}

/// <summary>Gets the number of milliseconds elapsed since the system started.</summary>
/// <value>A 32-bit signed integer containing the amount of time in milliseconds that has passed since the last time the computer was started.</value>
public static extern int TickCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading;

namespace System
Expand Down Expand Up @@ -203,6 +204,12 @@ public static Version Version
}
}

public static string StackTrace
{
[MethodImpl(MethodImplOptions.NoInlining)] // Prevent inlining from affecting where the stacktrace starts
get => new StackTrace(true).ToString(System.Diagnostics.StackTrace.TraceFormat.Normal);
}

private static bool ValidateAndConvertRegistryTarget(EnvironmentVariableTarget target)
{
Debug.Assert(target != EnvironmentVariableTarget.Process);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ public static extern int ExitCode
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern int GetProcessorCount();

public static string StackTrace
{
[MethodImpl(MethodImplOptions.NoInlining)] // Prevent inlining from affecting where the stacktrace starts
get => new StackTrace(true).ToString(Diagnostics.StackTrace.TraceFormat.Normal);
}

public static extern int TickCount
{
[MethodImplAttribute(MethodImplOptions.InternalCall)]
Expand Down