-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 source_file bug in mono_ppdb_lookup_location_internal #96497
Fix source_file bug in mono_ppdb_lookup_location_internal #96497
Conversation
document-records affect sequence points that follow in the byte stream, not points previously read. When reading the document-record we may already be at the target offset. Do not update docname local if we have reached the end target already otherwise the wrong source_file will be reported for the requested offset
@thaystg Can you think of a way to add a test for this? (I have verified the fix in Unity) Our bug was from a class that had the ctor method body defined in one file and variables with initializers in another. |
"The last variable initialization line file name would be reported incorrectly." does it mean that you could not step in the correct line, right? |
If this is the case you can create a test case on wasm debugger tests. runtime/src/mono/browser/debugger/DebuggerTestSuite/BreakpointTests.cs Lines 135 to 136 in 5a2d151
Like this one, trying to add a breakpoint at the last variable initialization line. Please let me know if you need any help to do it. |
It affects the Code Coverage tool https://docs.unity3d.com/ScriptReference/TestTools.Coverage.GetStatsForAllCoveredMethods.html I think you can see this issue, even though there is not much info https://issuetracker.unity3d.com/issues/coverage-api-returns-wrong-file-path-for-fields-in-partial-class-that-are-declared-with-an-initial-value |
@thaystg I have not been able to add a test to the BreakpointTests. As soon as I add a field with initializer to a partial class in the Also any reason to be concerned about the 'Build browser-wasm linux Release Mono_DebuggerTests_chrome' failure? |
@ilonatommy if you have any available time, can you try to create a test case for this one? |
This seems to have caused a regression: |
Let's revert this and backport the PR to net9 preview1? |
Unity 1897 was patched with Unity-Technologies/mono#1941 |
document-records affect sequence points that follow in the byte stream, not points previously read.
When reading the document-record we may already be at the target offset. Do not update docname local if we have reached the end target already otherwise the wrong source_file will be reported for the requested offset