-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[Debugging] Breakpoints in .razor
files, which are not in the @code
block won't bind
#19339
Comments
From @mihaimyh on Thursday, March 26, 2020 9:48:24 PM Neither those in a "code-behind" class, like FetchData.razor.cs. |
I am not 100% sure but also debugging razor class libraries is not working. Until now I was not able to debug anything WASM related using latest WebAssembly 3.2.0 Preview 3, but I will try and see if this is just something on my side. |
.razor
files, which are not in the @code
block won't bind.razor
files, which are not in the @code
block won't bind
Breakpoints on the loop work fine, I'm not familiar enough with how razor sequence points map to the runtime to understand why this is failing /cc @vargaz |
Sequence point -> File/line mapping is picked up from the .pdb files. It doesn't matter whenever it is a .cs file or some other source file. |
@thaystg can you look into what is going on here and why we can't hit breakpoints in the body of the razor loop. |
The problem is in rzc.dll, which is responsible for generating the .g.cs file from razor file. https://gist.github.com/thaystg/be141b64b68c21701d796e19b4c868c6.js Without any change in rzc.dll the generated file is like this:
And it doesn't stop on line 6.
I'm not sure exactly why, but the problem is with the generated file, I think that it's because the #line 6 and the #line hidden is in the same command, so the csc consider that the line is hidden and is not creating the right pdb, the line 6 is created as a hidden line, and that is the reason why the breakpoint doesn't stop. |
Does #19487 help? |
No, Larry, because ALL hidden breakpoints has line number= 0xfeefee, so we don't have the information of the right line number. |
@ajaybhargavb @NTaylorMullen Does this sound like any known issue with Razor line number generation? Would you have expected this to work? |
Definitely would have expected this to work. Razor has been generating this way for a longggg time and we haven't changed that behavior for close to a year. We purposefully are adding the line hidden directives to ensure that you don't debug into non-visible / non-C# code. |
Oh and the only "known" issue in Razor line pragma generation is that we can't specify columns so occasionally things are misaligned; however, Razor's been that way since day 0 😄 |
@NTaylorMullen this is an entirely new debugger we're just trying to understand how to interpret what we see in the pdb |
@thaystg can you see if your fixes to the sequence point choosing has resolved this? |
Yes, I'll check. |
No, Larry, it doesn't fix.
And as I expect it does not stop even when running on Blazor Server, which is a completely different debugger engine, because the cs file is generated in a way that the breakpoints are hidden, so it's impossible to stop, for wasm debugger engine and also for Blazor Server debugger engine. |
I think this has to be fixed on the Roslyn side. It's tracked in two locations: |
I'm going to close this mono/mono issue then since we're not expecting to do any work here and the issue isn't wasm specific |
From @mkArtakMSFT on Thursday, March 26, 2020 7:09:38 PM
Using the latest VS preview (16.6 Preview 3) release with the latest Blazor bits (3.2-preview3):
Copied from original issue: dotnet/aspnetcore#20200
The text was updated successfully, but these errors were encountered: