Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for missing trace event on first expression #281

Merged
merged 4 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading