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

Blazor WASM "step over" doesn't work properly for referenced assemblies #49142

Closed
RobertBouillon opened this issue Mar 4, 2021 · 7 comments
Closed
Assignees
Labels
arch-wasm WebAssembly architecture area-Debugger-mono
Milestone

Comments

@RobertBouillon
Copy link

Describe the bug

Pressing F10 (Step Over) when debugging a WASM project doesn't always step over the current expression. This can be frustrating when debugging because the STEP OVER command acts unpredictably

To Reproduce

  1. Create a new Blazor WASM project
  2. Add a new .NET library project to the solution
  3. Add the Foo class to the library with the code below
  4. Add a reference to the .NET library project from the WASM project
  5. Update the FetchData.razor page with the code below.
  6. Add a breakpoint in the Bar method of the Foo class where var d is defined.
  7. Start debugging
  8. Click on the "Fetch Data" link in the window
  9. The program should break on the breakpoint added in step 6
  10. Press F10 (or otherwise select STEP OVER in VS)

Expected Results

The current executing line of code should progress to the following line with Console.WriteLine

Actual Results

The current executing line of code remains on the current line and requires a second press to continue as expected.

Notes

This only appears to affect code in referenced assemblies. If the body of Bar is copied to OnInitializedAsync, STEP OVER behaves as expected. Upon deeper investigation, it appears that the operands of && are being treated as separate lines of code when debugged from the referenced library.

Foo Class

public class Foo
{
    public void Bar()
    {
      var a = 1;
      var b = 2;
      var x = "Stew";
      var y = "00.123";
      var c = a + b == 3 || b + a == 2;
      var d = TimeSpan.TryParseExact(y, @"ss\.fff", null, out var ts) && x.Contains('S');
      Console.WriteLine(d);
    }

FetchData.razor

  protected override async Task OnInitializedAsync()
  {
    new BlazorBugsLib.Foo().Bart();
    forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("Bad URI");
  }
@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/aspnetcore Mar 4, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Mar 4, 2021
@mkArtakMSFT
Copy link
Member

@lewing FYI

@ghost
Copy link

ghost commented Mar 4, 2021

Tagging subscribers to this area: @CoffeeFlux
See info in area-owners.md if you want to be subscribed.

Issue Details

Describe the bug

Pressing F10 (Step Over) when debugging a WASM project doesn't always step over the current expression. This can be frustrating when debugging because the STEP OVER command acts unpredictably

To Reproduce

  1. Create a new Blazor WASM project
  2. Add a new .NET library project to the solution
  3. Add the Foo class to the library with the code below
  4. Add a reference to the .NET library project from the WASM project
  5. Update the FetchData.razor page with the code below.
  6. Add a breakpoint in the Bar method of the Foo class where var d is defined.
  7. Start debugging
  8. Click on the "Fetch Data" link in the window
  9. The program should break on the breakpoint added in step 6
  10. Press F10 (or otherwise select STEP OVER in VS)

Expected Results

The current executing line of code should progress to the following line with Console.WriteLine

Actual Results

The current executing line of code remains on the current line and requires a second press to continue as expected.

Notes

This only appears to affect code in referenced assemblies. If the body of Bar is copied to OnInitializedAsync, STEP OVER behaves as expected. Upon deeper investigation, it appears that the operands of && are being treated as separate lines of code when debugged from the referenced library.

Foo Class

public class Foo
{
    public void Bar()
    {
      var a = 1;
      var b = 2;
      var x = "Stew";
      var y = "00.123";
      var c = a + b == 3 || b + a == 2;
      var d = TimeSpan.TryParseExact(y, @"ss\.fff", null, out var ts) && x.Contains('S');
      Console.WriteLine(d);
    }

FetchData.razor

  protected override async Task OnInitializedAsync()
  {
    new BlazorBugsLib.Foo().Bart();
    forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("Bad URI");
  }
Author: RobertBouillon
Assignees: -
Labels:

area-VM-meta-mono, untriaged

Milestone: -

@ghost
Copy link

ghost commented Mar 4, 2021

Tagging subscribers to this area: @thaystg
See info in area-owners.md if you want to be subscribed.

Issue Details

Describe the bug

Pressing F10 (Step Over) when debugging a WASM project doesn't always step over the current expression. This can be frustrating when debugging because the STEP OVER command acts unpredictably

To Reproduce

  1. Create a new Blazor WASM project
  2. Add a new .NET library project to the solution
  3. Add the Foo class to the library with the code below
  4. Add a reference to the .NET library project from the WASM project
  5. Update the FetchData.razor page with the code below.
  6. Add a breakpoint in the Bar method of the Foo class where var d is defined.
  7. Start debugging
  8. Click on the "Fetch Data" link in the window
  9. The program should break on the breakpoint added in step 6
  10. Press F10 (or otherwise select STEP OVER in VS)

Expected Results

The current executing line of code should progress to the following line with Console.WriteLine

Actual Results

The current executing line of code remains on the current line and requires a second press to continue as expected.

Notes

This only appears to affect code in referenced assemblies. If the body of Bar is copied to OnInitializedAsync, STEP OVER behaves as expected. Upon deeper investigation, it appears that the operands of && are being treated as separate lines of code when debugged from the referenced library.

Foo Class

public class Foo
{
    public void Bar()
    {
      var a = 1;
      var b = 2;
      var x = "Stew";
      var y = "00.123";
      var c = a + b == 3 || b + a == 2;
      var d = TimeSpan.TryParseExact(y, @"ss\.fff", null, out var ts) && x.Contains('S');
      Console.WriteLine(d);
    }

FetchData.razor

  protected override async Task OnInitializedAsync()
  {
    new BlazorBugsLib.Foo().Bart();
    forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("Bad URI");
  }
Author: RobertBouillon
Assignees: -
Labels:

area-Debugger-mono, untriaged

Milestone: -

@CoffeeFlux
Copy link
Contributor

cc: @radical @thaystg

@lewing lewing added the arch-wasm WebAssembly architecture label Mar 5, 2021
@ghost
Copy link

ghost commented Mar 5, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Describe the bug

Pressing F10 (Step Over) when debugging a WASM project doesn't always step over the current expression. This can be frustrating when debugging because the STEP OVER command acts unpredictably

To Reproduce

  1. Create a new Blazor WASM project
  2. Add a new .NET library project to the solution
  3. Add the Foo class to the library with the code below
  4. Add a reference to the .NET library project from the WASM project
  5. Update the FetchData.razor page with the code below.
  6. Add a breakpoint in the Bar method of the Foo class where var d is defined.
  7. Start debugging
  8. Click on the "Fetch Data" link in the window
  9. The program should break on the breakpoint added in step 6
  10. Press F10 (or otherwise select STEP OVER in VS)

Expected Results

The current executing line of code should progress to the following line with Console.WriteLine

Actual Results

The current executing line of code remains on the current line and requires a second press to continue as expected.

Notes

This only appears to affect code in referenced assemblies. If the body of Bar is copied to OnInitializedAsync, STEP OVER behaves as expected. Upon deeper investigation, it appears that the operands of && are being treated as separate lines of code when debugged from the referenced library.

Foo Class

public class Foo
{
    public void Bar()
    {
      var a = 1;
      var b = 2;
      var x = "Stew";
      var y = "00.123";
      var c = a + b == 3 || b + a == 2;
      var d = TimeSpan.TryParseExact(y, @"ss\.fff", null, out var ts) && x.Contains('S');
      Console.WriteLine(d);
    }

FetchData.razor

  protected override async Task OnInitializedAsync()
  {
    new BlazorBugsLib.Foo().Bart();
    forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("Bad URI");
  }
Author: RobertBouillon
Assignees: -
Labels:

arch-wasm, area-Debugger-mono, untriaged

Milestone: -

@lewing lewing removed the untriaged New issue has not been triaged by the area owner label Mar 5, 2021
@lewing lewing added this to the 6.0.0 milestone Mar 5, 2021
thaystg added a commit to thaystg/runtime that referenced this issue Jul 19, 2021
…ng debugger-libs+mono or coreclr.

Fix error message of evaluate calling methods.
Adding test for dotnet#49142
thaystg added a commit that referenced this issue Jul 21, 2021
* Creating test to close 49143.

* Creating test to close #49141

* Adding test for #49218.

* Fix behavior of step to be the same of what we see when debugging using debugger-libs+mono or coreclr.
Fix error message of evaluate calling methods.
Adding test for #49142

* Improving test to test what @radical asked.

* Changing what was suggested by @radical.
@lewing
Copy link
Member

lewing commented Jul 31, 2021

closing assuming this is fixed in #55915 @thaystg please reopen if not.

@lewing lewing closed this as completed Jul 31, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Debugger-mono
Projects
None yet
Development

No branches or pull requests

6 participants