Skip to content

Commit

Permalink
Avoid generating an empty sequencePoint element in PdbToXml tool
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat committed Apr 13, 2015
1 parent 2ad8197 commit 25de638
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,6 @@ public static void Main()
<slot kind=""28"" offset=""156"" ordinal=""1"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ public async Task M(IDisposable disposable)
<slot kind=""2"" offset=""410"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>
Expand Down
12 changes: 0 additions & 12 deletions src/Compilers/CSharp/Test/Emit/PDB/PDBAsyncTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ .locals init (int V_0,
<lambda offset=""86"" />
</encLambdaMap>
</customDebugInfo>
<sequencePoints />
</method>
<method containingType=""Driver"" name="".cctor"">
<customDebugInfo>
Expand Down Expand Up @@ -391,7 +390,6 @@ private Task<int> GetNextInt(Random random)
<customDebugInfo>
<forwardIterator name=""&lt;QBar&gt;d__2"" />
</customDebugInfo>
<sequencePoints />
</method>
<method containingType=""ConsoleApplication1.Program"" name=""ZBar"">
<customDebugInfo>
Expand All @@ -405,7 +403,6 @@ private Task<int> GetNextInt(Random random)
<slot kind=""28"" offset=""141"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints />
</method>
<method containingType=""ConsoleApplication1.Program"" name=""GetNextInt"" parameterNames=""random"">
<customDebugInfo>
Expand Down Expand Up @@ -642,7 +639,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<lambda offset=""95"" closure=""0"" />
</encLambdaMap>
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>");
Expand Down Expand Up @@ -742,7 +738,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<lambda offset=""95"" closure=""0"" />
</encLambdaMap>
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>");
Expand Down Expand Up @@ -831,7 +826,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<lambda offset=""95"" closure=""0"" />
</encLambdaMap>
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>");
Expand Down Expand Up @@ -931,7 +925,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<lambda offset=""95"" closure=""0"" />
</encLambdaMap>
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>");
Expand Down Expand Up @@ -1016,7 +1009,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<slot kind=""0"" offset=""19"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>
Expand Down Expand Up @@ -1095,7 +1087,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<customDebugInfo>
<forwardIterator name=""&lt;M&gt;d__0"" />
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>
Expand Down Expand Up @@ -1181,7 +1172,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<slot kind=""0"" offset=""19"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>
Expand Down Expand Up @@ -1286,7 +1276,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<slot kind=""28"" offset=""105"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>");
Expand Down Expand Up @@ -1552,7 +1541,6 @@ static async Task<int> G()
<slot kind=""29"" offset=""150"" ordinal=""3"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>");
Expand Down
14 changes: 0 additions & 14 deletions src/Compilers/CSharp/Test/Emit/PDB/PDBIteratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<customDebugInfo>
<forwardIterator name=""&lt;Foo&gt;d__0"" />
</customDebugInfo>
<sequencePoints />
</method>
<method containingType=""Program"" name=""F"">
<customDebugInfo>
Expand Down Expand Up @@ -89,7 +88,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<customDebugInfo>
<forwardIterator name=""&lt;Foo&gt;d__0"" />
</customDebugInfo>
<sequencePoints />
</method>
<method containingType=""Program"" name=""F"">
<customDebugInfo>
Expand Down Expand Up @@ -144,7 +142,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<customDebugInfo>
<forwardIterator name=""&lt;Foo&gt;d__0"" />
</customDebugInfo>
<sequencePoints />
</method>
<method containingType=""Program"" name=""F"">
<customDebugInfo>
Expand Down Expand Up @@ -207,7 +204,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<customDebugInfo>
<forwardIterator name=""&lt;IEI&gt;d__0"" />
</customDebugInfo>
<sequencePoints />
</method>
<method containingType=""Program"" name=""F"">
<customDebugInfo>
Expand Down Expand Up @@ -280,7 +276,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<slot kind=""0"" offset=""101"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints />
</method>
<method containingType=""Program"" name=""F"">
<customDebugInfo>
Expand Down Expand Up @@ -364,7 +359,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<slot kind=""0"" offset=""42"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints />
</method>
<method containingType=""Test`1"" name=""F"">
<customDebugInfo>
Expand Down Expand Up @@ -461,7 +455,6 @@ static void Main()
<customDebugInfo>
<forwardIterator name=""&lt;M&gt;d__0"" />
</customDebugInfo>
<sequencePoints />
</method>
<method containingType=""C"" name=""Main"">
<customDebugInfo>
Expand Down Expand Up @@ -596,19 +589,16 @@ public static void Main()
<slot kind=""0"" offset=""104"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints />
</method>
<method containingType=""Test`1"" name=""get_IterProp"">
<customDebugInfo>
<forwardIterator name=""&lt;get_IterProp&gt;d__3"" />
</customDebugInfo>
<sequencePoints />
</method>
<method containingType=""Test`1"" name=""IterMethod"">
<customDebugInfo>
<forwardIterator name=""&lt;IterMethod&gt;d__4"" />
</customDebugInfo>
<sequencePoints />
</method>
<method containingType=""Test"" name=""Main"">
<customDebugInfo>
Expand Down Expand Up @@ -991,7 +981,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<slot kind=""2"" offset=""367"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>");
Expand Down Expand Up @@ -1186,7 +1175,6 @@ .locals init (int V_0)
<lambda offset=""95"" closure=""0"" />
</encLambdaMap>
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>");
Expand Down Expand Up @@ -1342,7 +1330,6 @@ .locals init (int V_0,
<lambda offset=""95"" closure=""0"" />
</encLambdaMap>
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>");
Expand Down Expand Up @@ -1418,7 +1405,6 @@ public void F() { } // needs to be present to work around SymWriter bug #1068894
<slot kind=""0"" offset=""19"" />
</encLocalSlotMap>
</customDebugInfo>
<sequencePoints />
</method>
</methods>
</symbols>
Expand Down
3 changes: 0 additions & 3 deletions src/Compilers/VisualBasic/Test/Emit/PDB/PDBAsyncTests.vb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ End Module
<customDebugInfo>
<forwardIterator name="VB$StateMachine_1_F"/>
</customDebugInfo>
<sequencePoints/>
</method>
</methods>
</symbols>)
Expand Down Expand Up @@ -104,7 +103,6 @@ End Module
<customDebugInfo>
<forwardIterator name="VB$StateMachine_2_Test"/>
</customDebugInfo>
<sequencePoints/>
</method>
</methods>
</symbols>)
Expand Down Expand Up @@ -185,7 +183,6 @@ End Module
<customDebugInfo>
<forwardIterator name="VB$StateMachine_3_S"/>
</customDebugInfo>
<sequencePoints/>
</method>
</methods>
</symbols>)
Expand Down
8 changes: 6 additions & 2 deletions src/Test/PdbUtilities/Pdb/PdbToXml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1042,9 +1042,13 @@ private static Type GetConstantRuntimeType(ImmutableArray<byte> signature)
// A single method could span multiple files (use C#'s #line directive to see for yourself).
private void WriteSequencePoints(ISymUnmanagedMethod method)
{
_writer.WriteStartElement("sequencePoints");

var sequencePoints = method.GetSequencePoints();
if (sequencePoints.Length == 0)
{
return;
}

_writer.WriteStartElement("sequencePoints");

// Write out sequence points
foreach (var sequencePoint in sequencePoints)
Expand Down

0 comments on commit 25de638

Please sign in to comment.