未验证 提交 3596c0ce 编写于 作者: J Jason Malinowski 提交者: GitHub

Merge pull request #26241 from dotnet/merges/dev15.7.x-to-dev15.7.x-vs-deps

Merge dev15.7.x to dev15.7.x-vs-deps
...@@ -383,10 +383,10 @@ private string FormatPrimitive(DkmClrValue value, ObjectDisplayOptions options, ...@@ -383,10 +383,10 @@ private string FormatPrimitive(DkmClrValue value, ObjectDisplayOptions options,
object obj; object obj;
if (value.Type.GetLmrType().IsDateTime()) if (value.Type.GetLmrType().IsDateTime())
{ {
DkmClrValue dateDataValue = value.GetFieldValue(DateTimeUtilities.DateTimeDateDataFieldName, inspectionContext); DkmClrValue dateDataValue = value.GetPropertyValue("Ticks", inspectionContext);
Debug.Assert(dateDataValue.HostObjectValue != null); Debug.Assert(dateDataValue.HostObjectValue != null);
obj = DateTimeUtilities.ToDateTime((ulong)dateDataValue.HostObjectValue); obj = new DateTime((long)dateDataValue.HostObjectValue);
} }
else else
{ {
......
...@@ -330,6 +330,11 @@ internal static DkmClrValue GetFieldValue(this DkmClrValue value, string name, D ...@@ -330,6 +330,11 @@ internal static DkmClrValue GetFieldValue(this DkmClrValue value, string name, D
return value.GetMemberValue(name, (int)MemberTypes.Field, ParentTypeName: null, InspectionContext: inspectionContext); return value.GetMemberValue(name, (int)MemberTypes.Field, ParentTypeName: null, InspectionContext: inspectionContext);
} }
internal static DkmClrValue GetPropertyValue(this DkmClrValue value, string name, DkmInspectionContext inspectionContext)
{
return value.GetMemberValue(name, (int)MemberTypes.Property, ParentTypeName: null, InspectionContext: inspectionContext);
}
internal static DkmClrValue GetNullableValue(this DkmClrValue value, Type nullableTypeArg, DkmInspectionContext inspectionContext) internal static DkmClrValue GetNullableValue(this DkmClrValue value, Type nullableTypeArg, DkmInspectionContext inspectionContext)
{ {
var valueType = value.Type.GetLmrType(); var valueType = value.Type.GetLmrType();
......
...@@ -6,8 +6,6 @@ namespace Roslyn.Utilities ...@@ -6,8 +6,6 @@ namespace Roslyn.Utilities
{ {
internal static class DateTimeUtilities internal static class DateTimeUtilities
{ {
internal const string DateTimeDateDataFieldName = "dateData";
// From DateTime.cs. // From DateTime.cs.
private const long TicksMask = 0x3FFFFFFFFFFFFFFF; private const long TicksMask = 0x3FFFFFFFFFFFFFFF;
...@@ -18,13 +16,5 @@ internal static DateTime ToDateTime(double raw) ...@@ -18,13 +16,5 @@ internal static DateTime ToDateTime(double raw)
var tickCount = BitConverter.DoubleToInt64Bits(raw) & TicksMask; var tickCount = BitConverter.DoubleToInt64Bits(raw) & TicksMask;
return new DateTime(tickCount); return new DateTime(tickCount);
} }
internal static DateTime ToDateTime(ulong raw)
{
// This mechanism for getting the tick count from the underlying ulong field is copied
// from System.DateTime.InternalTicks (ndp\clr\src\BCL\System\DateTime.cs).
var tickCount = unchecked((long)raw) & TicksMask;
return new DateTime(tickCount);
}
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册