Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
915da6a5
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,发现更多精彩内容 >>
未验证
提交
915da6a5
编写于
6月 26, 2020
作者:
M
msftbot[bot]
提交者:
GitHub
6月 26, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #45381 from tmat/StackTraceLineNumbers
Include line numbers in Integration Test stack traces
上级
2545d2c9
69a2f558
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
32 deletion
+4
-32
src/Compilers/Core/Portable/InternalUtilities/FailFast.cs
src/Compilers/Core/Portable/InternalUtilities/FailFast.cs
+1
-28
src/VisualStudio/IntegrationTest/IntegrationService/IntegrationService.cs
.../IntegrationTest/IntegrationService/IntegrationService.cs
+2
-0
src/VisualStudio/IntegrationTest/TestUtilities/VisualStudioInstanceFactory.cs
...egrationTest/TestUtilities/VisualStudioInstanceFactory.cs
+1
-4
未找到文件。
src/Compilers/Core/Portable/InternalUtilities/FailFast.cs
浏览文件 @
915da6a5
...
...
@@ -27,8 +27,7 @@ internal static void OnFatalException(Exception exception)
#if !NET20
// don't fail fast with an aggregate exception that is masking true exception
var
aggregate
=
exception
as
AggregateException
;
if
(
aggregate
!=
null
&&
aggregate
.
InnerExceptions
.
Count
==
1
)
if
(
exception
is
AggregateException
aggregate
&&
aggregate
.
InnerExceptions
.
Count
==
1
)
{
exception
=
aggregate
.
InnerExceptions
[
0
];
}
...
...
@@ -72,32 +71,6 @@ internal static void DumpStackTrace(Exception? exception = null, string? message
}
}
#if !NET20 && !NETSTANDARD1_3
Console
.
WriteLine
(
"Stack trace of handler"
);
var
stackTrace
=
new
StackTrace
();
Console
.
WriteLine
(
stackTrace
.
ToString
());
#endif
Console
.
Out
.
Flush
();
}
/// <summary>
/// Dumps the stack trace of the exception and the handler to the console. This is useful
/// for debugging unit tests that hit a fatal exception
/// </summary>
[
Conditional
(
"DEBUG"
)]
private
static
void
DumpStackTrace
(
Exception
exception
)
{
Console
.
WriteLine
(
"Dumping info before call to failfast"
);
Console
.
WriteLine
(
"Exception info"
);
for
(
Exception
?
current
=
exception
;
current
is
object
;
current
=
current
!.
InnerException
)
{
Console
.
WriteLine
(
current
.
Message
);
Console
.
WriteLine
(
current
.
StackTrace
);
current
=
current
.
InnerException
;
}
#if !NET20 && !NETSTANDARD1_3
Console
.
WriteLine
(
"Stack trace of handler"
);
var
stackTrace
=
new
StackTrace
();
...
...
src/VisualStudio/IntegrationTest/IntegrationService/IntegrationService.cs
浏览文件 @
915da6a5
...
...
@@ -29,6 +29,8 @@ internal class IntegrationService : MarshalByRefObject
public
IntegrationService
()
{
AppContext
.
SetSwitch
(
"Switch.System.Diagnostics.IgnorePortablePDBsInStackTraces"
,
false
);
PortName
=
GetPortName
(
Process
.
GetCurrentProcess
().
Id
);
BaseUri
=
"ipc://"
+
this
.
PortName
;
}
...
...
src/VisualStudio/IntegrationTest/TestUtilities/VisualStudioInstanceFactory.cs
浏览文件 @
915da6a5
...
...
@@ -78,10 +78,7 @@ private static void FirstChanceExceptionHandler(object sender, FirstChanceExcept
Directory
.
CreateDirectory
(
logDir
);
var
exception
=
eventArgs
.
Exception
;
File
.
WriteAllText
(
Path
.
Combine
(
logDir
,
$"
{
baseFileName
}
.log"
),
$"
{
exception
}
.GetType().Name
{
Environment
.
NewLine
}{
exception
.
StackTrace
}
"
);
File
.
WriteAllText
(
Path
.
Combine
(
logDir
,
$"
{
baseFileName
}
.log"
),
eventArgs
.
Exception
.
ToString
());
EventLogCollector
.
TryWriteDotNetEntriesToFile
(
Path
.
Combine
(
logDir
,
$"
{
baseFileName
}
.DotNet.log"
));
EventLogCollector
.
TryWriteWatsonEntriesToFile
(
Path
.
Combine
(
logDir
,
$"
{
baseFileName
}
.Watson.log"
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录