提交 c1af09e0 编写于 作者: T Tomas Matousek

Comments and rename

上级 d6324501
......@@ -411,7 +411,7 @@ public void UsingInfo2()
0x01, 0x00, // using count #1
0x02, 0x00, // using count #2
0x03, 0x00, // using count #3
0x04, 0x00, // using count #3
0x04, 0x00, // using count #4
0x00, 0x00 // alignment
}, cdi);
}
......
......@@ -84,7 +84,7 @@ public byte[] SerializeMethodDebugInfo(EmitContext context, IMethodBody methodBo
var encoder = new CustomDebugInfoEncoder(pooledBuilder);
// NOTE: This is an attempt to match Dev10's apparent behavior. For iterator methods (i.e. the method
// that appears in source, not the synthesized ones), Dev10 only emits the ForwardIterator and IteratorLocal
// that appears in source, not the synthesized ones), Dev10 only emits the StateMachineTypeName
// custom debug info (e.g. there will be no information about the usings that were in scope).
// NOTE: There seems to be an unusual behavior in ISymUnmanagedWriter where, if all the methods in a type are
// iterator methods, no custom debug info is emitted for any method. Adding a single non-iterator
......@@ -93,7 +93,7 @@ public byte[] SerializeMethodDebugInfo(EmitContext context, IMethodBody methodBo
// is not a regression).
if (methodBody.StateMachineTypeName != null)
{
encoder.AddForwardIteratorInfo(methodBody.StateMachineTypeName);
encoder.AddStateMachineTypeName(methodBody.StateMachineTypeName);
}
else
{
......
......@@ -48,13 +48,13 @@ public byte[] ToArray()
return Builder.ToArray();
}
public void AddForwardIteratorInfo(string iteratorClassName)
public void AddStateMachineTypeName(string typeName)
{
Debug.Assert(iteratorClassName != null);
Debug.Assert(typeName != null);
AddRecord(
CustomDebugInfoKind.ForwardIteratorInfo,
iteratorClassName,
CustomDebugInfoKind.StateMachineTypeName,
typeName,
(name, builder) =>
{
builder.WriteUTF16(name);
......
......@@ -7,14 +7,54 @@
/// </summary>
internal enum CustomDebugInfoKind : byte
{
/// <summary>
/// C# only. Encodes the sizes of using groups that are applicable to the method.
/// The actual import strings are stored separately trhu ISymUnmanagedWriter.UsingNamespace.
/// </summary>
UsingGroups = 0,
/// <summary>
/// C# only. Indicates that per-method debug information (import strings) is stored on another method,
/// whose token is specified.
/// </summary>
ForwardMethodInfo = 1,
/// <summary>
/// C# only. Indicates that per-module debug information (assembly reference aliases) is stored on another method,
/// whose token is specified.
/// </summary>
ForwardModuleInfo = 2,
/// <summary>
/// C# only. Specifies local scopes for state machine hoisted local variables.
/// </summary>
StateMachineHoistedLocalScopes = 3,
ForwardIteratorInfo = 4,
/// <summary>
/// C# and VB. The name of the state machine type. Emitted for async and iterator kick-off methods.
/// </summary>
StateMachineTypeName = 4,
/// <summary>
/// C# only. Dynamic flags for local variables and constants.
/// </summary>
DynamicLocals = 5,
/// <summary>
/// C# and VB. Encodes EnC local variable slot map.
/// See https://github.com/dotnet/corefx/blob/master/src/System.Reflection.Metadata/specs/PortablePdb-Metadata.md#EditAndContinueLocalSlotMap.
/// </summary>
EditAndContinueLocalSlotMap = 6,
/// <summary>
/// C# and VB. Encodes EnC lambda map.
/// See https://github.com/dotnet/corefx/blob/master/src/System.Reflection.Metadata/specs/PortablePdb-Metadata.md#EditAndContinueLambdaAndClosureMap.
/// </summary>
EditAndContinueLambdaMap = 7,
/// <summary>
/// C# and VB. Tuple element names for local variables and constants.
/// </summary>
TupleElementNames = 8,
}
}
......@@ -290,7 +290,7 @@ private void WriteCustomDebugInfo(byte[] bytes)
case CustomDebugInfoKind.StateMachineHoistedLocalScopes:
WriteStateMachineHoistedLocalScopesCustomDebugInfo(record);
break;
case CustomDebugInfoKind.ForwardIteratorInfo:
case CustomDebugInfoKind.StateMachineTypeName:
WriteForwardIteratorCustomDebugInfo(record);
break;
case CustomDebugInfoKind.DynamicLocals:
......@@ -443,7 +443,7 @@ private void WriteStateMachineHoistedLocalScopesCustomDebugInfo(CustomDebugInfoR
/// </remarks>
private void WriteForwardIteratorCustomDebugInfo(CustomDebugInfoRecord record)
{
Debug.Assert(record.Kind == CustomDebugInfoKind.ForwardIteratorInfo);
Debug.Assert(record.Kind == CustomDebugInfoKind.StateMachineTypeName);
_writer.WriteStartElement("forwardIterator");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册