Skip to content

Commit

Permalink
Fix for missing trace event on first expression (#281)
Browse files Browse the repository at this point in the history
* Fix for missing trace event on first expression

* Update build actions

* Fix packaging

* Fix packaging
  • Loading branch information
slozier authored Nov 27, 2024
1 parent fe26cf4 commit ce7ce74
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 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@v2
- uses: actions/checkout@v4
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '3.1.x'
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
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@v2
- uses: actions/upload-artifact@v4
with:
name: packages
name: packages-${{ matrix.os }}
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>false</DebugSymbols>
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
Expand Down
19 changes: 7 additions & 12 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,17 +355,12 @@ protected override MSAst.Expression VisitDebugInfo(MSAst.DebugInfoExpression nod
// Update the location cookie
int locationCookie = _locationCookie++;
if (!_transformToGenerator) {
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))
);
}
var 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 ce7ce74

Please sign in to comment.