Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
75a273ba
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
75a273ba
编写于
2月 25, 2015
作者:
K
Kevin Halverson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
DkmClrValue.GetMemberValue also needs a DkmInspectionContext parameter...
上级
4b77f764
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
39 addition
and
31 deletion
+39
-31
src/ExpressionEvaluator/CSharp/Test/ResultProvider/FormatSpecifierTests.cs
...luator/CSharp/Test/ResultProvider/FormatSpecifierTests.cs
+4
-4
src/ExpressionEvaluator/CSharp/Test/ResultProvider/ResultsViewTests.cs
...nEvaluator/CSharp/Test/ResultProvider/ResultsViewTests.cs
+1
-1
src/ExpressionEvaluator/Core/Source/Concord/Microsoft.VisualStudio.Debugger.Engine.il
.../Source/Concord/Microsoft.VisualStudio.Debugger.Engine.il
+8
-5
src/ExpressionEvaluator/Core/Source/ResultProvider/Expansion/MemberExpansion.cs
...r/Core/Source/ResultProvider/Expansion/MemberExpansion.cs
+4
-4
src/ExpressionEvaluator/Core/Source/ResultProvider/Formatter.Values.cs
...nEvaluator/Core/Source/ResultProvider/Formatter.Values.cs
+10
-10
src/ExpressionEvaluator/Core/Source/ResultProvider/Helpers/TypeHelpers.cs
...aluator/Core/Source/ResultProvider/Helpers/TypeHelpers.cs
+5
-5
src/ExpressionEvaluator/Core/Source/ResultProvider/ResultProvider.cs
...ionEvaluator/Core/Source/ResultProvider/ResultProvider.cs
+1
-1
src/ExpressionEvaluator/Core/Test/ResultProvider/Debugger/Engine/DkmClrValue.cs
...r/Core/Test/ResultProvider/Debugger/Engine/DkmClrValue.cs
+6
-1
未找到文件。
src/ExpressionEvaluator/CSharp/Test/ResultProvider/FormatSpecifierTests.cs
浏览文件 @
75a273ba
...
...
@@ -439,11 +439,11 @@ internal ArrayList Q
{
var
type
=
runtime
.
GetType
(
"C"
);
var
value
=
CreateDkmClrValue
(
type
.
Instantiate
(),
type
:
type
);
var
memberValue
=
value
.
GetMemberValue
(
"P"
,
(
int
)
System
.
Reflection
.
MemberTypes
.
Property
,
"C"
);
var
memberValue
=
value
.
GetMemberValue
(
"P"
,
(
int
)
System
.
Reflection
.
MemberTypes
.
Property
,
"C"
,
DefaultInspectionContext
);
var
evalResult
=
FormatResult
(
"o.P"
,
"o.P, results"
,
memberValue
,
inspectionContext
:
CreateDkmInspectionContext
(
DkmEvaluationFlags
.
ResultsOnly
));
Verify
(
evalResult
,
EvalFailedResult
(
"o.P"
,
"'o.P' threw an exception of type 'System.NotImplementedException'"
));
memberValue
=
value
.
GetMemberValue
(
"Q"
,
(
int
)
System
.
Reflection
.
MemberTypes
.
Property
,
"C"
);
memberValue
=
value
.
GetMemberValue
(
"Q"
,
(
int
)
System
.
Reflection
.
MemberTypes
.
Property
,
"C"
,
DefaultInspectionContext
);
evalResult
=
FormatResult
(
"o.Q"
,
"o.Q, results"
,
memberValue
,
inspectionContext
:
CreateDkmInspectionContext
(
DkmEvaluationFlags
.
ResultsOnly
));
Verify
(
evalResult
,
EvalFailedResult
(
"o.Q"
,
"'o.Q' threw an exception of type 'E'"
));
...
...
@@ -489,11 +489,11 @@ internal int Q
{
var
type
=
runtime
.
GetType
(
"C"
);
var
value
=
CreateDkmClrValue
(
type
.
Instantiate
(),
type
:
type
);
var
memberValue
=
value
.
GetMemberValue
(
"P"
,
(
int
)
System
.
Reflection
.
MemberTypes
.
Property
,
"C"
);
var
memberValue
=
value
.
GetMemberValue
(
"P"
,
(
int
)
System
.
Reflection
.
MemberTypes
.
Property
,
"C"
,
DefaultInspectionContext
);
var
evalResult
=
FormatResult
(
"o.P"
,
"o.P, results"
,
memberValue
,
inspectionContext
:
CreateDkmInspectionContext
(
DkmEvaluationFlags
.
ResultsOnly
));
Verify
(
evalResult
,
EvalFailedResult
(
"o.P"
,
"Property 'P' evaluation timed out"
));
memberValue
=
value
.
GetMemberValue
(
"Q"
,
(
int
)
System
.
Reflection
.
MemberTypes
.
Property
,
"C"
);
memberValue
=
value
.
GetMemberValue
(
"Q"
,
(
int
)
System
.
Reflection
.
MemberTypes
.
Property
,
"C"
,
DefaultInspectionContext
);
evalResult
=
FormatResult
(
"o.Q"
,
"o.Q, results"
,
memberValue
,
inspectionContext
:
CreateDkmInspectionContext
(
DkmEvaluationFlags
.
ResultsOnly
));
Verify
(
evalResult
,
EvalFailedResult
(
"o.Q"
,
"Property 'Q' evaluation timed out"
));
...
...
src/ExpressionEvaluator/CSharp/Test/ResultProvider/ResultsViewTests.cs
浏览文件 @
75a273ba
...
...
@@ -1483,7 +1483,7 @@ internal ArrayList P
{
var
type
=
runtime
.
GetType
(
"C"
);
var
value
=
CreateDkmClrValue
(
type
.
Instantiate
(),
type
:
type
);
var
memberValue
=
value
.
GetMemberValue
(
"P"
,
(
int
)
System
.
Reflection
.
MemberTypes
.
Property
,
"C"
);
var
memberValue
=
value
.
GetMemberValue
(
"P"
,
(
int
)
System
.
Reflection
.
MemberTypes
.
Property
,
"C"
,
DefaultInspectionContext
);
var
evalResult
=
FormatResult
(
"o.P"
,
memberValue
);
Verify
(
evalResult
,
EvalFailedResult
(
"o.P"
,
"Function evaluation timed out"
,
"System.Collections.ArrayList"
,
"o.P"
));
...
...
src/ExpressionEvaluator/Core/Source/Concord/Microsoft.VisualStudio.Debugger.Engine.il
浏览文件 @
75a273ba
// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.3
4209
// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.3
3440
// Copyright (c) Microsoft Corporation. All rights reserved.
...
...
@@ -39,13 +39,13 @@
.ver 1:0:0:0
}
.module Microsoft.VisualStudio.Debugger.Engine.dll
// MVID: {
6ACEF75E-71AE-4A5E-A3C0-CAD7BC16BC75
}
// MVID: {
0F7065FE-E352-4628-8FE7-0426F0FBBB7F
}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x0
288
0000
// Image base: 0x0
10C
0000
// =============== CLASS MEMBERS DECLARATION ===================
...
...
@@ -6979,6 +6979,7 @@
.field public static literal valuetype Microsoft.VisualStudio.Debugger.DkmExceptionCode E_XAPI_REMOTE_DISCONNECTED = int32(0x8EDE0011)
.field public static literal valuetype Microsoft.VisualStudio.Debugger.DkmExceptionCode E_XAPI_REMOTE_NEW_VER_REQUIRED = int32(0x8EDE0024)
.field public static literal valuetype Microsoft.VisualStudio.Debugger.DkmExceptionCode E_XAPI_SERVER_ONLY_METHOD = int32(0x8EDE0022)
.field public static literal valuetype Microsoft.VisualStudio.Debugger.DkmExceptionCode E_XAPI_STA_THREADS_NOT_SUPPORTED = int32(0x8EDE0026)
.field public static literal valuetype Microsoft.VisualStudio.Debugger.DkmExceptionCode E_XAPI_THREAD_ABORTED = int32(0x8EDE0003)
.field public static literal valuetype Microsoft.VisualStudio.Debugger.DkmExceptionCode E_XAPI_UNAVAILABLE_OBJECT = int32(0x8EDE0005)
.field public static literal valuetype Microsoft.VisualStudio.Debugger.DkmExceptionCode E_XAPI_WORKLIST_ALREADY_STARTED = int32(0x8EDE000B)
...
...
@@ -22950,7 +22951,8 @@
.method public hidebysig instance class Microsoft.VisualStudio.Debugger.Evaluation.ClrCompilation.DkmClrValue
GetMemberValue(string MemberName,
int32 MemberType,
string ParentTypeName) cil managed
string ParentTypeName,
class Microsoft.VisualStudio.Debugger.Evaluation.DkmInspectionContext InspectionContext) cil managed
{
// Code size 1 (0x1)
.maxstack 8
...
...
@@ -24126,7 +24128,8 @@
GetMemberValue(class Microsoft.VisualStudio.Debugger.Evaluation.ClrCompilation.DkmClrValue clrValue,
string memberName,
int32 memberType,
string parentTypeName) cil managed
string parentTypeName,
class Microsoft.VisualStudio.Debugger.Evaluation.DkmInspectionContext inspectionContext) cil managed
{
} // end of method IDkmClrValueInspectionCallback::GetMemberValue
src/ExpressionEvaluator/Core/Source/ResultProvider/Expansion/MemberExpansion.cs
浏览文件 @
75a273ba
...
...
@@ -224,7 +224,7 @@ private MemberExpansion(MemberAndDeclarationInfo[] members)
MemberAndDeclarationInfo
member
,
EvalResultDataItem
parent
)
{
var
memberValue
=
GetMemberValue
(
value
,
member
);
var
memberValue
=
GetMemberValue
(
value
,
member
,
inspectionContext
);
return
CreateMemberDataItem
(
resultProvider
,
inspectionContext
,
...
...
@@ -234,11 +234,11 @@ private MemberExpansion(MemberAndDeclarationInfo[] members)
ExpansionFlags
.
All
);
}
private
static
DkmClrValue
GetMemberValue
(
DkmClrValue
container
,
MemberAndDeclarationInfo
member
)
private
static
DkmClrValue
GetMemberValue
(
DkmClrValue
container
,
MemberAndDeclarationInfo
member
,
DkmInspectionContext
inspectionContext
)
{
// Note: GetMemberValue() may return special value
// when func-eval of properties is disabled.
return
container
.
GetMemberValue
(
member
.
Name
,
(
int
)
member
.
MemberType
,
member
.
DeclaringType
.
FullName
);
return
container
.
GetMemberValue
(
member
.
Name
,
(
int
)
member
.
MemberType
,
member
.
DeclaringType
.
FullName
,
inspectionContext
);
}
private
sealed
class
RootHiddenExpansion
:
Expansion
...
...
@@ -261,7 +261,7 @@ internal RootHiddenExpansion(MemberAndDeclarationInfo member)
bool
visitAll
,
ref
int
index
)
{
var
memberValue
=
GetMemberValue
(
value
,
_member
);
var
memberValue
=
GetMemberValue
(
value
,
_member
,
inspectionContext
);
if
(
memberValue
.
IsError
())
{
if
(
InRange
(
startIndex
,
count
,
index
))
...
...
src/ExpressionEvaluator/Core/Source/ResultProvider/Formatter.Values.cs
浏览文件 @
75a273ba
...
...
@@ -60,7 +60,7 @@ internal string GetValueString(DkmClrValue value, DkmInspectionContext inspectio
{
return
IncludeObjectId
(
value
,
FormatPrimitive
(
value
,
options
&
~
ObjectDisplayOptions
.
UseQuotes
),
FormatPrimitive
(
value
,
options
&
~
ObjectDisplayOptions
.
UseQuotes
,
inspectionContext
),
flags
);
}
}
...
...
@@ -72,7 +72,7 @@ internal string GetValueString(DkmClrValue value, DkmInspectionContext inspectio
{
return
IncludeObjectId
(
value
,
GetEnumDisplayString
(
lmrType
,
value
,
options
,
(
flags
&
GetValueFlags
.
IncludeTypeName
)
!=
0
),
GetEnumDisplayString
(
lmrType
,
value
,
options
,
(
flags
&
GetValueFlags
.
IncludeTypeName
)
!=
0
,
inspectionContext
),
flags
);
}
else
if
(
lmrType
.
IsArray
)
...
...
@@ -86,13 +86,13 @@ internal string GetValueString(DkmClrValue value, DkmInspectionContext inspectio
{
// NOTE: the HostObjectValue will have a size corresponding to the process bitness
// and FormatPrimitive will adjust accordingly.
var
tmp
=
FormatPrimitive
(
value
,
ObjectDisplayOptions
.
UseHexadecimalNumbers
);
// Always in hex.
var
tmp
=
FormatPrimitive
(
value
,
ObjectDisplayOptions
.
UseHexadecimalNumbers
,
inspectionContext
);
// Always in hex.
Debug
.
Assert
(
tmp
!=
null
);
return
tmp
;
}
else
if
(
lmrType
.
IsNullable
())
{
var
nullableValue
=
value
.
GetNullableValue
();
var
nullableValue
=
value
.
GetNullableValue
(
inspectionContext
);
// It should be impossible to nest nullables, so this recursion should introduce only a single extra stack frame.
return
nullableValue
==
null
?
_nullString
...
...
@@ -156,7 +156,7 @@ private string GetUnderlyingStringImpl(DkmClrValue value, DkmInspectionContext i
if
(
lmrType
.
IsNullable
())
{
var
nullableValue
=
value
.
GetNullableValue
();
var
nullableValue
=
value
.
GetNullableValue
(
inspectionContext
);
return
nullableValue
!=
null
?
GetUnderlyingStringImpl
(
nullableValue
,
inspectionContext
)
:
null
;
}
...
...
@@ -169,7 +169,7 @@ private string GetUnderlyingStringImpl(DkmClrValue value, DkmInspectionContext i
// Check for special cased non-primitives that have underlying strings
if
(
string
.
Equals
(
lmrType
.
FullName
,
"System.Data.SqlTypes.SqlString"
,
StringComparison
.
Ordinal
))
{
var
fieldValue
=
value
.
GetFieldValue
(
InternalWellKnownMemberNames
.
SqlStringValue
);
var
fieldValue
=
value
.
GetFieldValue
(
InternalWellKnownMemberNames
.
SqlStringValue
,
inspectionContext
);
return
fieldValue
.
HostObjectValue
as
string
;
}
...
...
@@ -196,7 +196,7 @@ private string GetUnderlyingStringImpl(DkmClrValue value, DkmInspectionContext i
/// NOTE: no curlies for enum values.
/// </remarks>
#pragma warning restore RS0010
private
string
GetEnumDisplayString
(
Type
lmrType
,
DkmClrValue
value
,
ObjectDisplayOptions
options
,
bool
includeTypeName
)
private
string
GetEnumDisplayString
(
Type
lmrType
,
DkmClrValue
value
,
ObjectDisplayOptions
options
,
bool
includeTypeName
,
DkmInspectionContext
inspectionContext
)
{
Debug
.
Assert
(
lmrType
.
IsEnum
);
Debug
.
Assert
(
value
!=
null
);
...
...
@@ -221,7 +221,7 @@ private string GetEnumDisplayString(Type lmrType, DkmClrValue value, ObjectDispl
}
fields
.
Free
();
return
displayString
??
FormatPrimitive
(
value
,
options
);
return
displayString
??
FormatPrimitive
(
value
,
options
,
inspectionContext
);
}
private
static
void
FillEnumFields
(
ArrayBuilder
<
EnumField
>
fields
,
Type
lmrType
)
...
...
@@ -363,14 +363,14 @@ internal string GetEditableValue(DkmClrValue value, DkmInspectionContext inspect
return
null
;
}
internal
string
FormatPrimitive
(
DkmClrValue
value
,
ObjectDisplayOptions
options
)
internal
string
FormatPrimitive
(
DkmClrValue
value
,
ObjectDisplayOptions
options
,
DkmInspectionContext
inspectionContext
)
{
Debug
.
Assert
(
value
!=
null
);
object
obj
;
if
(
value
.
Type
.
GetLmrType
().
IsDateTime
())
{
DkmClrValue
dateDataValue
=
value
.
GetFieldValue
(
DateTimeUtilities
.
DateTimeDateDataFieldName
);
DkmClrValue
dateDataValue
=
value
.
GetFieldValue
(
DateTimeUtilities
.
DateTimeDateDataFieldName
,
inspectionContext
);
Debug
.
Assert
(
dateDataValue
.
HostObjectValue
!=
null
);
obj
=
DateTimeUtilities
.
ToDateTime
((
ulong
)
dateDataValue
.
HostObjectValue
);
...
...
src/ExpressionEvaluator/Core/Source/ResultProvider/Helpers/TypeHelpers.cs
浏览文件 @
75a273ba
...
...
@@ -284,22 +284,22 @@ internal static bool IsNullable(this Type type)
return
type
.
GetNullableTypeArgument
()
!=
null
;
}
internal
static
DkmClrValue
GetFieldValue
(
this
DkmClrValue
value
,
string
name
)
internal
static
DkmClrValue
GetFieldValue
(
this
DkmClrValue
value
,
string
name
,
DkmInspectionContext
inspectionContext
)
{
return
value
.
GetMemberValue
(
name
,
(
int
)
MemberTypes
.
Field
,
ParentTypeName
:
null
);
return
value
.
GetMemberValue
(
name
,
(
int
)
MemberTypes
.
Field
,
ParentTypeName
:
null
,
InspectionContext
:
inspectionContext
);
}
internal
static
DkmClrValue
GetNullableValue
(
this
DkmClrValue
value
)
internal
static
DkmClrValue
GetNullableValue
(
this
DkmClrValue
value
,
DkmInspectionContext
inspectionContext
)
{
Debug
.
Assert
(
value
.
Type
.
GetLmrType
().
IsNullable
());
var
hasValue
=
value
.
GetFieldValue
(
InternalWellKnownMemberNames
.
NullableHasValue
);
var
hasValue
=
value
.
GetFieldValue
(
InternalWellKnownMemberNames
.
NullableHasValue
,
inspectionContext
);
if
(
object
.
Equals
(
hasValue
.
HostObjectValue
,
false
))
{
return
null
;
}
return
value
.
GetFieldValue
(
InternalWellKnownMemberNames
.
NullableValue
);
return
value
.
GetFieldValue
(
InternalWellKnownMemberNames
.
NullableValue
,
inspectionContext
);
}
internal
static
Type
GetBaseTypeOrNull
(
this
Type
underlyingType
,
DkmClrAppDomain
appDomain
,
out
DkmClrType
type
)
...
...
src/ExpressionEvaluator/Core/Source/ResultProvider/ResultProvider.cs
浏览文件 @
75a273ba
...
...
@@ -297,7 +297,7 @@ private static string GetTypeName(DkmInspectionContext inspectionContext, DkmClr
{
Debug
.
Assert
(
value
.
Type
.
GetProxyType
()
==
null
);
var
nullableValue
=
value
.
GetNullableValue
();
var
nullableValue
=
value
.
GetNullableValue
(
inspectionContext
);
if
(
nullableValue
==
null
)
{
Debug
.
Assert
(
declaredType
.
Equals
(
value
.
Type
.
GetLmrType
()));
...
...
src/ExpressionEvaluator/Core/Test/ResultProvider/Debugger/Engine/DkmClrValue.cs
浏览文件 @
75a273ba
...
...
@@ -323,8 +323,13 @@ public void EvaluateDebuggerDisplayString(DkmWorkList workList, DkmInspectionCon
workList
.
AddWork
(()
=>
completionRoutine
(
new
DkmEvaluateDebuggerDisplayStringAsyncResult
(
pooled
.
ToStringAndFree
())));
}
public
DkmClrValue
GetMemberValue
(
string
MemberName
,
int
MemberType
,
string
ParentTypeName
)
public
DkmClrValue
GetMemberValue
(
string
MemberName
,
int
MemberType
,
string
ParentTypeName
,
DkmInspectionContext
InspectionContext
)
{
if
(
InspectionContext
==
null
)
{
throw
new
ArgumentNullException
(
"inspectionContext"
);
}
var
runtime
=
this
.
Type
.
RuntimeInstance
;
var
memberValue
=
runtime
.
GetMemberValue
(
this
,
MemberName
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录