Skip to content

Commit

Permalink
Merge pull request dotnet#1963 from tmat/RemoveEmptySP
Browse files Browse the repository at this point in the history
Avoid generating an empty sequencePoint element in PdbToXml tool
  • Loading branch information
tmat committed Apr 14, 2015
2 parents b61047b + 25de638 commit 4d691ac
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 @@ -213,7 +213,6 @@ .locals init (int V_0,
<lambda offset=""86"" />
</encLambdaMap>
</customDebugInfo>
<sequencePoints />
</method>
<method containingType=""TestCase"" name="".cctor"">
<customDebugInfo>
Expand Down Expand Up @@ -398,7 +397,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 @@ -412,7 +410,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 @@ -663,7 +660,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 @@ -763,7 +759,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 @@ -852,7 +847,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 @@ -952,7 +946,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 @@ -1037,7 +1030,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 @@ -1116,7 +1108,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 @@ -1202,7 +1193,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 @@ -1307,7 +1297,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 @@ -1573,7 +1562,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 4d691ac

Please sign in to comment.