Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
3f35532d
F
fsharp
项目概览
dotNET Platform
/
fsharp
12 个月 前同步成功
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fsharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3f35532d
编写于
9月 06, 2016
作者:
K
Kevin Ransom (msft)
提交者:
GitHub
9月 06, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Portable PDB generation did not emit sequence points and local variables correctly (#1516)
上级
71c8798e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
28 deletion
+31
-28
src/absil/ilwritepdb.fs
src/absil/ilwritepdb.fs
+31
-28
未找到文件。
src/absil/ilwritepdb.fs
浏览文件 @
3f35532d
...
...
@@ -249,6 +249,7 @@ let writePortablePdbInfo (fixupSPs:bool) showTimes fpdb (info:PdbData) =
index
.
Add
(
doc
.
File
,
handle
)
index
let
mutable
lastLocalVariableHandle
=
Unchecked
.
defaultof
<
LocalVariableHandle
>
metadata
.
SetCapacity
(
TableIndex
.
MethodDebugInformation
,
info
.
Methods
.
Length
)
info
.
Methods
|>
Array
.
iteri
(
fun
_
i
minfo
->
let
docHandle
,
sequencePointBlob
=
...
...
@@ -272,26 +273,28 @@ let writePortablePdbInfo (fixupSPs:bool) showTimes fpdb (info:PdbData) =
// If part of the method body is in another document returns nil handle.
let
tryGetSingleDocumentIndex
=
let
mutable
singleDocumentIndex
=
0
for
i
in
1
..
sps
.
Length
-
1
do
for
i
in
0
..
sps
.
Length
-
1
do
let
index
=
sps
.[
i
].
Document
if
index
<>
singleDocumentIndex
then
singleDocumentIndex
<-
index
singleDocumentIndex
if
sps
.
Length
=
0
then
// Filter out feefee (Hidden) sequence points
let
sps
=
sps
|>
Array
.
filter
(
fun
sp
->
sp
.
Line
<>
0xfeefee
&&
sp
.
EndLine
<>
0xfeefee
)
if
sps
.
Length
=
0
then
Unchecked
.
defaultof
<
DocumentHandle
>,
Unchecked
.
defaultof
<
BlobHandle
>
else
let
builder
=
new
BlobBuilder
()
builder
.
WriteCompressedInteger
(
minfo
.
LocalSignatureToken
)
let
mutable
previousNonHiddenStartLine
=
-
1
let
mutable
previousNonHiddenStartColumn
=
-
1
let
mutable
previousDocumentIndex
=
-
1
let
mutable
singleDocumentIndex
=
tryGetSingleDocumentIndex
let
mutable
currentDocumentIndex
=
previousDocumentIndex
for
i
in
0
..
(
sps
.
Length
-
1
)
do
let
builder
=
new
BlobBuilder
()
builder
.
WriteCompressedInteger
(
minfo
.
LocalSignatureToken
)
for
i
in
0
..
(
sps
.
Length
-
1
)
do
if
previousDocumentIndex
<>
currentDocumentIndex
then
// optional document in header or document record:
if
previousDocumentIndex
<>
-
1
then
...
...
@@ -306,16 +309,9 @@ let writePortablePdbInfo (fixupSPs:bool) showTimes fpdb (info:PdbData) =
else
builder
.
WriteCompressedInteger
(
sps
.[
i
].
Offset
)
// F# does not support hidden sequence points yet !!!
// if (sequencePoints[i].IsHidden)
// {
// builder.WriteInt16(0);
// continue;
// }
let
deltaLines
=
sps
.[
i
].
EndLine
-
sps
.[
i
].
Line
;
let
deltaColumns
=
sps
.[
i
].
EndColumn
-
sps
.[
i
].
Column
;
builder
.
WriteCompressedInteger
(
deltaLines
);
let
deltaLines
=
sps
.[
i
].
EndLine
-
sps
.[
i
].
Line
let
deltaColumns
=
sps
.[
i
].
EndColumn
-
sps
.[
i
].
Column
builder
.
WriteCompressedInteger
(
deltaLines
)
if
deltaLines
=
0
then
builder
.
WriteCompressedInteger
(
deltaColumns
)
...
...
@@ -335,23 +331,30 @@ let writePortablePdbInfo (fixupSPs:bool) showTimes fpdb (info:PdbData) =
getDocumentHandle
singleDocumentIndex
,
metadata
.
GetOrAddBlob
(
builder
)
// Write the scopes
let
mutable
lastLocalVariableHandle
=
Unchecked
.
defaultof
<
LocalVariableHandle
>
// Write the scopes
let
nextHandle
handle
=
MetadataTokens
.
LocalVariableHandle
(
MetadataTokens
.
GetRowNumber
(
LocalVariableHandle
.
op_Implicit
(
handle
))
+
1
)
let
rec
writePdbScope
top
scope
=
if
top
||
scope
.
Locals
.
Length
<>
0
||
scope
.
Children
.
Length
<>
0
then
lastLocalVariableHandle
<-
nextHandle
lastLocalVariableHandle
let
rec
writePdbScope
scope
=
if
scope
.
Children
.
Length
=
0
then
metadata
.
AddLocalScope
(
MetadataTokens
.
MethodDefinitionHandle
(
minfo
.
MethToken
),
Unchecked
.
defaultof
<
ImportScopeHandle
>,
nextHandle
lastLocalVariableHandle
,
Unchecked
.
defaultof
<
LocalConstantHandle
>,
0
,
scope
.
EndOffset
-
scope
.
StartOffset
)
|>
ignore
else
metadata
.
AddLocalScope
(
MetadataTokens
.
MethodDefinitionHandle
(
minfo
.
MethToken
),
Unchecked
.
defaultof
<
ImportScopeHandle
>,
lastLocalVariableHandle
,
Unchecked
.
defaultof
<
LocalConstantHandle
>,
scope
.
StartOffset
,
scope
.
EndOffset
-
scope
.
StartOffset
)
|>
ignore
Unchecked
.
defaultof
<
ImportScopeHandle
>,
nextHandle
lastLocalVariableHandle
,
Unchecked
.
defaultof
<
LocalConstantHandle
>,
scope
.
StartOffset
,
scope
.
EndOffset
-
scope
.
StartOffset
)
|>
ignore
for
localVariable
in
scope
.
Locals
do
lastLocalVariableHandle
<-
metadata
.
AddLocalVariable
(
LocalVariableAttributes
.
None
,
localVariable
.
Index
,
metadata
.
GetOrAddString
(
localVariable
.
Name
))
scope
.
Children
|>
Array
.
iter
(
writePdbScope
false
)
writePdbScope
true
minfo
.
RootScope
scope
.
Children
|>
Array
.
iter
(
writePdbScope
)
writePdbScope
minfo
.
RootScope
metadata
.
AddMethodDebugInformation
(
docHandle
,
sequencePointBlob
)
|>
ignore
)
let
entryPoint
=
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录