Skip to content

[wasm][debugger] fixing setting a breakpoint in an invalid IL offset after hotreload - #75561

Merged
lewing merged 6 commits into
dotnet:mainfrom
thaystg:thays_fix_75492
Sep 14, 2022
Merged

[wasm][debugger] fixing setting a breakpoint in an invalid IL offset after hotreload#75561
lewing merged 6 commits into
dotnet:mainfrom
thaystg:thays_fix_75492

Conversation

@thaystg

Copy link
Copy Markdown
Member

It's not possible to add a test case because it is a concurrency issue, let me try to explain:

  • You apply a change using hot reload;
  • The metadata and pdb is already updated on runtime side but not on debugger side;
  • We receive a setBreakpoint command from VS, then we find the IL and try to set the breakpoint on runtime side.
  • The IL offset doesn't exist on runtime side, it returns an error on set breakpoint and it was throwing an exception.

The fix was to remove the exception throw and check the return of the set breakpoint function.

Fixes#75492

@thaystg
thaystg requested a review from lewingSeptember 13, 2022 20:49
@ghostghost assigned thaystgSep 13, 2022
@ghost

Copy link
Copy Markdown

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

Issue Details

It's not possible to add a test case because it is a concurrency issue, let me try to explain:

  • You apply a change using hot reload;
  • The metadata and pdb is already updated on runtime side but not on debugger side;
  • We receive a setBreakpoint command from VS, then we find the IL and try to set the breakpoint on runtime side.
  • The IL offset doesn't exist on runtime side, it returns an error on set breakpoint and it was throwing an exception.

The fix was to remove the exception throw and check the return of the set breakpoint function.

Fixes #75492

Author:thaystg
Assignees:-
Labels:

area-Debugger-mono

Milestone:-

Comment threadsrc/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs Outdated
Co-authored-by: Ankit Jain <radical@gmail.com>
Comment threadsrc/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs Outdated
Comment threadsrc/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs Outdated
@radicalradical added the arch-wasm WebAssembly architecture label Sep 13, 2022
@ghost

Copy link
Copy Markdown

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

Issue Details

It's not possible to add a test case because it is a concurrency issue, let me try to explain:

  • You apply a change using hot reload;
  • The metadata and pdb is already updated on runtime side but not on debugger side;
  • We receive a setBreakpoint command from VS, then we find the IL and try to set the breakpoint on runtime side.
  • The IL offset doesn't exist on runtime side, it returns an error on set breakpoint and it was throwing an exception.

The fix was to remove the exception throw and check the return of the set breakpoint function.

Fixes #75492

Author:thaystg
Assignees:thaystg
Labels:

arch-wasm, area-Debugger-mono

Milestone:-

@thaystg

Copy link
Copy Markdown
MemberAuthor

/backport to release/7.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3048571879

@lewing
lewing merged commit 63dbc82 into dotnet:mainSep 14, 2022
@ghostghost locked as resolved and limited conversation to collaborators Oct 14, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-Debugger-mono

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hot reloading a change in Blazor WebAssembly app after hitting a breakpoint causes browser to crash

3 participants

@thaystg@radical@lewing