提交 a5bcdd4c 编写于 作者: T TomasMatousek

A few tiny renames/tweaks to support Portable PDB implementation. (changeset 1412018)

上级 855519d9
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
......
......@@ -234,7 +234,7 @@ public void AssemblyRefs_DuplicateRows()
context,
compilation.MessageProvider,
stream,
pdbWriterOpt: null,
nativePdbWriterOpt: null,
allowMissingMethodBodies: false,
deterministic: false,
cancellationToken: CancellationToken.None);
......
B// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
......
......@@ -6,4 +6,12 @@ public enum DebugInformationFormat
{
Pdb = 1,
}
internal static partial class DebugInformationFormatExtensions
{
internal static bool IsValid(this DebugInformationFormat value)
{
return value == DebugInformationFormat.Pdb;
}
}
}
......@@ -180,7 +180,7 @@ public override int GetHashCode()
internal void ValidateOptions(DiagnosticBag diagnostics, CommonMessageProvider messageProvider)
{
if (DebugInformationFormat != DebugInformationFormat.Pdb)
if (!DebugInformationFormat.IsValid())
{
diagnostics.Add(messageProvider.CreateDiagnostic(messageProvider.ERR_InvalidDebugInformationFormat, Location.None, (int)DebugInformationFormat));
}
......
B// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
......
B// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
......
B// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
......@@ -262,7 +262,7 @@ internal CompilationContext CreateCompilationContext(CSharpSyntaxNode syntax)
new EmitContext((Cci.IModule)moduleBuilder, null, diagnostics),
context.MessageProvider,
stream,
pdbWriterOpt: null,
nativePdbWriterOpt: null,
allowMissingMethodBodies: false,
deterministic: false,
cancellationToken: default(CancellationToken));
......@@ -362,7 +362,7 @@ internal CompilationContext CreateCompilationContext(CSharpSyntaxNode syntax)
new EmitContext((Cci.IModule)moduleBuilder, null, diagnostics),
context.MessageProvider,
stream,
pdbWriterOpt: null,
nativePdbWriterOpt: null,
allowMissingMethodBodies: false,
deterministic: false,
cancellationToken: default(CancellationToken));
......@@ -411,7 +411,7 @@ internal CompilationContext CreateCompilationContext(CSharpSyntaxNode syntax)
new EmitContext((Cci.IModule)moduleBuilder, null, diagnostics),
context.MessageProvider,
stream,
pdbWriterOpt: null,
nativePdbWriterOpt: null,
allowMissingMethodBodies: false,
deterministic: false,
cancellationToken: default(CancellationToken));
......
......@@ -351,7 +351,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator
New EmitContext(DirectCast(moduleBuilder, Cci.IModule), Nothing, diagnostics),
context.MessageProvider,
stream,
pdbWriterOpt:=Nothing,
nativePdbWriterOpt:=Nothing,
allowMissingMethodBodies:=False,
deterministic:=False,
cancellationToken:=Nothing)
......@@ -408,7 +408,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator
New EmitContext(DirectCast(modulebuilder, Cci.IModule), Nothing, diagnostics),
context.MessageProvider,
stream,
pdbWriterOpt:=Nothing,
nativePdbWriterOpt:=Nothing,
allowMissingMethodBodies:=False,
deterministic:=False,
cancellationToken:=Nothing)
......@@ -456,7 +456,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator
New EmitContext(DirectCast(modulebuilder, Cci.IModule), Nothing, diagnostics),
context.MessageProvider,
stream,
pdbWriterOpt:=Nothing,
nativePdbWriterOpt:=Nothing,
allowMissingMethodBodies:=False,
deterministic:=False,
cancellationToken:=Nothing)
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.CodeAnalysis;
using System;
......@@ -156,7 +156,7 @@ internal static class CommonCompilationExtensions
context,
compilation.MessageProvider,
stream,
pdbWriterOpt: null,
nativePdbWriterOpt: null,
allowMissingMethodBodies: false,
deterministic: false,
cancellationToken: cancellationToken);
......
......@@ -1030,9 +1030,6 @@ private void WriteSequencePoints(ISymUnmanagedMethod method)
writer.WriteStartElement("entry");
writer.WriteAttributeString("offset", AsILOffset(sequencePoint.Offset));
// If it's a special 0xFeeFee sequence point (eg, "hidden"),
// place an attribute on it to make it very easy for tools to recognize.
// See http://blogs.msdn.com/jmstall/archive/2005/06/19/FeeFee_SequencePoints.aspx
if (sequencePoint.IsHidden)
{
if (sequencePoint.StartLine != sequencePoint.EndLine || sequencePoint.StartColumn != 0 || sequencePoint.EndColumn != 0)
......@@ -1052,10 +1049,9 @@ private void WriteSequencePoints(ISymUnmanagedMethod method)
writer.WriteAttributeString("endColumn", CultureInvariantToString(sequencePoint.EndColumn));
}
//EDMAURER allow there to be PDBs generated for sources that don't have a name (document).
int fileRefVal = -1;
this.m_fileMapping.TryGetValue(sequencePoint.Document.GetName(), out fileRefVal);
writer.WriteAttributeString("document", CultureInvariantToString(fileRefVal));
int documentId;
this.m_fileMapping.TryGetValue(sequencePoint.Document.GetName(), out documentId);
writer.WriteAttributeString("document", CultureInvariantToString(documentId));
writer.WriteEndElement();
}
......@@ -1314,37 +1310,6 @@ internal static string AsILOffset(int i)
return string.Format(CultureInfo.InvariantCulture, "0x{0:x}", i);
}
internal static int ToInt32(string input)
{
return ToInt32(input, 10);
}
internal static int ToInt32(string input, int numberBase)
{
return Convert.ToInt32(input, numberBase);
}
internal static string ToHexString(byte[] input)
{
PooledStringBuilder pooled = PooledStringBuilder.GetInstance();
StringBuilder sb = pooled.Builder;
foreach (byte b in input)
{
sb.AppendFormat("{0:X2}", b);
}
return pooled.ToStringAndFree();
}
internal static byte[] ToByteArray(string input)
{
byte[] retval = new byte[input.Length];
for (int i = 0; i < input.Length; i++)
{
retval[i] = Convert.ToByte(input[i]);
}
return retval;
}
internal static string CultureInvariantToString(int input)
{
return input.ToString(CultureInfo.InvariantCulture);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册