Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
108a556b
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,发现更多精彩内容 >>
提交
108a556b
编写于
3月 31, 2015
作者:
T
Tomáš Matoušek
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1711 from tmat/PdbTimestamp
Fix timestamp written to Debug Image Directory
上级
fe5298a7
8b6bacea
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
6 deletion
+33
-6
src/Compilers/Core/Portable/PEWriter/ISymbolWriter.cs
src/Compilers/Core/Portable/PEWriter/ISymbolWriter.cs
+11
-0
src/Compilers/Core/Portable/PEWriter/PdbWriter.cs
src/Compilers/Core/Portable/PEWriter/PdbWriter.cs
+8
-2
src/Compilers/Core/Portable/PEWriter/PeWriter.cs
src/Compilers/Core/Portable/PEWriter/PeWriter.cs
+14
-4
未找到文件。
src/Compilers/Core/Portable/PEWriter/ISymbolWriter.cs
浏览文件 @
108a556b
...
...
@@ -58,6 +58,17 @@ internal interface ISymUnmanagedWriter2
void
DefineConstant2
([
MarshalAs
(
UnmanagedType
.
LPWStr
)]
string
name
,
VariantStructure
value
,
uint
sigToken
);
}
[
ComImport
,
InterfaceType
(
ComInterfaceType
.
InterfaceIsIUnknown
),
Guid
(
"98ECEE1E-752D-11d3-8D56-00C04F680B2B"
),
SuppressUnmanagedCodeSecurity
]
internal
interface
IPdbWriter
{
int
__SetPath
(
/*[in] const WCHAR* szFullPathName, [in] IStream* pIStream, [in] BOOL fFullBuild*/
);
int
__OpenMod
(
/*[in] const WCHAR* szModuleName, [in] const WCHAR* szFileName*/
);
int
__CloseMod
();
int
__GetPath
(
/*[in] DWORD ccData,[out] DWORD* pccData,[out, size_is(ccData),length_is(*pccData)] WCHAR szPath[]*/
);
void
GetSignatureAge
(
out
uint
sig
,
out
uint
age
);
}
internal
static
class
ISymUnmanagedWriter2Helper
{
public
static
unsafe
void
DefineConstant2
(
this
ISymUnmanagedWriter2
writer
,
string
name
,
object
value
,
uint
sigToken
)
...
...
src/Compilers/Core/Portable/PEWriter/PdbWriter.cs
浏览文件 @
108a556b
...
...
@@ -577,7 +577,7 @@ public void SetMetadataEmitter(MetadataWriter metadataWriter)
}
}
public
unsafe
Guid
GetDebugDirectoryGuid
(
)
public
unsafe
void
GetDebugDirectoryGuidAndStamp
(
out
Guid
guid
,
out
uint
stamp
)
{
// See symwrite.cpp - the data byte[] doesn't depend on the content of metadata tables or IL.
// The writer only sets two values of the ImageDebugDirectory struct.
...
...
@@ -626,7 +626,13 @@ public unsafe Guid GetDebugDirectoryGuid()
byte
[]
guidBytes
=
new
byte
[
GuidSize
];
Buffer
.
BlockCopy
(
data
,
4
,
guidBytes
,
0
,
guidBytes
.
Length
);
return
new
Guid
(
guidBytes
);
guid
=
new
Guid
(
guidBytes
);
// Retrieve the timestamp the PDB writer generates when creating a new PDB stream.
// Note that ImageDebugDirectory.TimeDateStamp is not set by GetDebugInfo,
// we need to go thru IPdbWriter interface to get it.
uint
age
;
((
IPdbWriter
)
_symWriter
).
GetSignatureAge
(
out
stamp
,
out
age
);
}
public
void
SetEntryPoint
(
uint
entryMethodToken
)
...
...
src/Compilers/Core/Portable/PEWriter/PeWriter.cs
浏览文件 @
108a556b
...
...
@@ -1442,12 +1442,24 @@ private void WriteDebugTable(Stream peStream, MetadataSizes metadataSizes, out l
MemoryStream
stream
=
new
MemoryStream
();
BinaryWriter
writer
=
new
BinaryWriter
(
stream
);
Guid
pdbId
;
uint
pdbStamp
;
if
(
_nativePdbWriterOpt
!=
null
)
{
_nativePdbWriterOpt
.
GetDebugDirectoryGuidAndStamp
(
out
pdbId
,
out
pdbStamp
);
}
else
{
pdbId
=
Guid
.
NewGuid
();
pdbStamp
=
0
;
}
// characteristics:
writer
.
WriteUint
(
0
);
// timestamp from NT headers
timestampOffset
=
writer
.
BaseStream
.
Position
+
peStream
.
Position
;
writer
.
WriteUint
(
_ntHeader
.
TimeDate
Stamp
);
writer
.
WriteUint
(
pdb
Stamp
);
// version
writer
.
WriteUint
(
0
);
...
...
@@ -1472,9 +1484,7 @@ private void WriteDebugTable(Stream peStream, MetadataSizes metadataSizes, out l
writer
.
WriteByte
((
byte
)
'D'
);
writer
.
WriteByte
((
byte
)
'S'
);
// TODO: use deterministic hash
Guid
guid
=
_nativePdbWriterOpt
?.
GetDebugDirectoryGuid
()
??
Guid
.
NewGuid
();
writer
.
WriteBytes
(
guid
.
ToByteArray
());
writer
.
WriteBytes
(
pdbId
.
ToByteArray
());
// Age (EnC generation + 1): always 0x00000001.
// We don't emit PE files when emitting EnC deltas.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录