-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[debugger] Fix debugging on Mac and iOS #71436
Conversation
Tagging subscribers to this area: @thaystg Issue DetailsWe need to set this: runtime/src/mono/mono/mini/interp/interp.c Line 8123 in 4adb117
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1558698
|
@lewing @lambdageek If you approve I think we should backport it to .net6, what do you think? |
verified 🐿 |
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/2625416084 |
@steveisok backporting to release/6.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix debugging on Mac and iOS
Using index info to reconstruct a base tree...
M src/mono/mono/component/debugger-agent.c
M src/mono/mono/mini/mini-runtime.c
Falling back to patching base and 3-way merge...
Auto-merging src/mono/mono/mini/mini-runtime.c
CONFLICT (content): Merge conflict in src/mono/mono/mini/mini-runtime.c
Auto-merging src/mono/mono/component/debugger-agent.c
CONFLICT (content): Merge conflict in src/mono/mono/component/debugger-agent.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix debugging on Mac and iOS
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
Backport dotnet/runtime#71436 Backport of #21516 to 2020-02 Co-authored-by: Thays Grazia <[email protected]>
New commits in mono/mono: * mono/mono@2a19f878dab Backport dotnet/runtime#71436 * mono/mono@6051b710727 Bump nuget.exe to v6.2.1 * mono/mono@f354099a6b6 Set app context to null on thread detach * mono/mono@6c7e72dd8e0 [mono] Fix a crash during stack trace construction if a this object is null. Diff: https://github.com/mono/mono/compare/dffa5ab92245f2419238a35b7c2052e9a24036b4..2a19f878dab8d2e62123e0bf29453de553f5402a
New commits in mono/mono: * mono/mono@2a19f878dab Backport dotnet/runtime#71436 * mono/mono@6051b710727 Bump nuget.exe to v6.2.1 * mono/mono@f354099a6b6 Set app context to null on thread detach * mono/mono@6c7e72dd8e0 [mono] Fix a crash during stack trace construction if a this object is null. Diff: https://github.com/mono/mono/compare/dffa5ab92245f2419238a35b7c2052e9a24036b4..2a19f878dab8d2e62123e0bf29453de553f5402a
…15451) There's a bug in the Mono runtime where the interpreter does not disable optimizations when the debugger is attached, which leads to the interpreter optimizing code and the debugger ending up rather confused. The bug is fixed in the Mono runtime (dotnet/runtime#71436), but there's no immediate way for the runtime to release this fix, so here we're implementing a workaround that disables interpreter optimizations if the debugging is enabled. It's somewhat clunky because the Mono external API wasn't designed for this, so we have to abuse the API a bit to accomplish the effect we want. This is somewhat risky (since we're changing the startup path in a pretty big way), but there's an escape hatch via an environment variable, and also the workaround will not be in effect for release builds. While the runtime issue exists in legacy mono/mono as well, we'll fix the Mono runtime for legacy, because we don't have to wait to consume legacy mono (#15507). This means that the workaround is for .NET scenarios only. Co-authored-by: Manuel de la Pena <[email protected]> Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
…otnet#15451) There's a bug in the Mono runtime where the interpreter does not disable optimizations when the debugger is attached, which leads to the interpreter optimizing code and the debugger ending up rather confused. The bug is fixed in the Mono runtime (dotnet/runtime#71436), but there's no immediate way for the runtime to release this fix, so here we're implementing a workaround that disables interpreter optimizations if the debugging is enabled. It's somewhat clunky because the Mono external API wasn't designed for this, so we have to abuse the API a bit to accomplish the effect we want. This is somewhat risky (since we're changing the startup path in a pretty big way), but there's an escape hatch via an environment variable, and also the workaround will not be in effect for release builds. While the runtime issue exists in legacy mono/mono as well, we'll fix the Mono runtime for legacy, because we don't have to wait to consume legacy mono (dotnet#15507). This means that the workaround is for .NET scenarios only. Co-authored-by: Manuel de la Pena <[email protected]> Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
There's a bug in the Mono runtime where the interpreter does not disable optimizations when the debugger is attached, which leads to the interpreter optimizing code and the debugger ending up rather confused. The bug is fixed in the Mono runtime (dotnet/runtime#71436), but there's no immediate way for the runtime to release this fix, so here we're implementing a workaround that disables interpreter optimizations if the debugging is enabled. It's somewhat clunky because the Mono external API wasn't designed for this, so we have to abuse the API a bit to accomplish the effect we want. This is somewhat risky (since we're changing the startup path in a pretty big way), but there's an escape hatch via an environment variable, and also the workaround will not be in effect for release builds. While the runtime issue exists in legacy mono/mono as well, we'll fix the Mono runtime for legacy, because we don't have to wait to consume legacy mono (dotnet#15507). This means that the workaround is for .NET scenarios only. This is a backport of #dotnet#15451.
There's a bug in the Mono runtime where the interpreter does not disable optimizations when the debugger is attached, which leads to the interpreter optimizing code and the debugger ending up rather confused. The bug is fixed in the Mono runtime (dotnet/runtime#71436), but there's no immediate way for the runtime to release this fix, so here we're implementing a workaround that disables interpreter optimizations if the debugging is enabled. It's somewhat clunky because the Mono external API wasn't designed for this, so we have to abuse the API a bit to accomplish the effect we want. This is somewhat risky (since we're changing the startup path in a pretty big way), but there's an escape hatch via an environment variable, and also the workaround will not be in effect for release builds. While the runtime issue exists in legacy mono/mono as well, we'll fix the Mono runtime for legacy, because we don't have to wait to consume legacy mono (dotnet#15507). This means that the workaround is for .NET scenarios only. This is a backport of #dotnet#15451.
…15510) There's a bug in the Mono runtime where the interpreter does not disable optimizations when the debugger is attached, which leads to the interpreter optimizing code and the debugger ending up rather confused. The bug is fixed in the Mono runtime (dotnet/runtime#71436), but there's no immediate way for the runtime to release this fix, so here we're implementing a workaround that disables interpreter optimizations if the debugging is enabled. It's somewhat clunky because the Mono external API wasn't designed for this, so we have to abuse the API a bit to accomplish the effect we want. This is somewhat risky (since we're changing the startup path in a pretty big way), but there's an escape hatch via an environment variable, and also the workaround will not be in effect for release builds. While the runtime issue exists in legacy mono/mono as well, we'll fix the Mono runtime for legacy, because we don't have to wait to consume legacy mono (#15507). This means that the workaround is for .NET scenarios only. This is a backport of ##15451. Co-authored-by: Thays Grazia <[email protected]>
…15509) There's a bug in the Mono runtime where the interpreter does not disable optimizations when the debugger is attached, which leads to the interpreter optimizing code and the debugger ending up rather confused. The bug is fixed in the Mono runtime (dotnet/runtime#71436), but there's no immediate way for the runtime to release this fix, so here we're implementing a workaround that disables interpreter optimizations if the debugging is enabled. It's somewhat clunky because the Mono external API wasn't designed for this, so we have to abuse the API a bit to accomplish the effect we want. This is somewhat risky (since we're changing the startup path in a pretty big way), but there's an escape hatch via an environment variable, and also the workaround will not be in effect for release builds. While the runtime issue exists in legacy mono/mono as well, we'll fix the Mono runtime for legacy, because we don't have to wait to consume legacy mono (#15507). This means that the workaround is for .NET scenarios only. This is a backport of ##15451. Co-authored-by: Thays Grazia <[email protected]>
New commits in mono/mono: * mono/mono@2a19f878dab Backport dotnet/runtime#71436 * mono/mono@6051b710727 Bump nuget.exe to v6.2.1 * mono/mono@f354099a6b6 Set app context to null on thread detach * mono/mono@6c7e72dd8e0 [mono] Fix a crash during stack trace construction if a this object is null. Diff: https://github.com/mono/mono/compare/dffa5ab92245f2419238a35b7c2052e9a24036b4..2a19f878dab8d2e62123e0bf29453de553f5402a Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
New commits in mono/mono: * mono/mono@2a19f878dab Backport dotnet/runtime#71436 * mono/mono@6051b710727 Bump nuget.exe to v6.2.1 * mono/mono@f354099a6b6 Set app context to null on thread detach * mono/mono@6c7e72dd8e0 [mono] Fix a crash during stack trace construction if a this object is null. Diff: https://github.com/mono/mono/compare/dffa5ab92245f2419238a35b7c2052e9a24036b4..2a19f878dab8d2e62123e0bf29453de553f5402a
We need to set this:
mini_get_debug_options ()->mdb_optimizations = TRUE;
before initialize the interpreter, otherwise the interpreter optimizations will be turned on and we will not be able to see the correct variable values.
runtime/src/mono/mono/mini/interp/interp.c
Line 8123 in 4adb117
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1558698
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1513227