Skip to content

Commit

Permalink
Revert "Fix for missing trace event on first expression (#281)"
Browse files Browse the repository at this point in the history
This reverts commit ce7ce74.
  • Loading branch information
slozier authored Nov 27, 2024
1 parent ce7ce74 commit 1840445
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@ jobs:
os: [windows-latest, ubuntu-latest, macos-latest-large]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v1
with:
dotnet-version: '9.0.x'
include-prerelease: true
- name: Build
run: pwsh make.ps1
- name: Package
run: pwsh make.ps1 package
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v2
with:
name: packages-${{ matrix.os }}
name: packages
path: Package/Release/Packages
- name: Test (net462)
run: ./make.ps1 -frameworks net462 test-all
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

<!-- Release -->
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugSymbols>true</DebugSymbols>
<DebugSymbols>false</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
Expand Down
19 changes: 12 additions & 7 deletions Src/Microsoft.Dynamic/Debugging/DebugInfoRewriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace Microsoft.Scripting.Debugging {
using Ast = MSAst.Expression;
using System.Threading;

/// <summary>
/// Used to rewrite expressions containing DebugInfoExpressions.
/// </summary>
Expand Down Expand Up @@ -355,12 +355,17 @@ protected override MSAst.Expression VisitDebugInfo(MSAst.DebugInfoExpression nod
// Update the location cookie
int locationCookie = _locationCookie++;
if (!_transformToGenerator) {
var tracebackCall = Ast.Call(
typeof(RuntimeOps).GetMethod(nameof(RuntimeOps.OnTraceEvent)),
_thread,
AstUtils.Constant(locationCookie),
Ast.Convert(Ast.Constant(null), typeof(Exception))
);
MSAst.Expression tracebackCall = null;
if (locationCookie == 0) {
tracebackCall = Ast.Empty();
} else {
tracebackCall = Ast.Call(
typeof(RuntimeOps).GetMethod(nameof(RuntimeOps.OnTraceEvent)),
_thread,
AstUtils.Constant(locationCookie),
Ast.Convert(Ast.Constant(null), typeof(Exception))
);
}

transformedExpression = Ast.Block(
Ast.Assign(
Expand Down

0 comments on commit 1840445

Please sign in to comment.