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

Cannot step over Debugger.Break() in m3 lldb #108541

Closed
successgo opened this issue Oct 4, 2024 · 5 comments · Fixed by #108560
Closed

Cannot step over Debugger.Break() in m3 lldb #108541

successgo opened this issue Oct 4, 2024 · 5 comments · Fixed by #108560
Assignees
Labels
area-Diagnostics-coreclr in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@successgo
Copy link

Description

Using lldb and sos to debug .net, while write below C# code:

Debugger.Break();

it will generate below asm:

->  0x10087ba38 <+0>: brk    #0
    0x10087ba3c <+4>: ret

but it never step over the brk, the only way to modify pc register manually.

Reproduction Steps

using System.Diagnostics;

namespace ConsoleApp1;

class Program
{
    static void Main(string[] args)
    {
        Debugger.Break();
    }
}

Compile and launch with lldb and run it.

Expected behavior

Enter ni to step over brk.

Actual behavior

Always hitting the brk.

Regression?

No response

Known Workarounds

Modify the pc register manully.

Configuration

No response

Other information

No response

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Oct 4, 2024
Copy link
Contributor

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

@janvorli
Copy link
Member

janvorli commented Oct 4, 2024

I believe that's a limitation of lldb.

@janvorli
Copy link
Member

janvorli commented Oct 4, 2024

However, maybe using another brk instruction flavor might help: https://stackoverflow.com/questions/75934525/stepping-over-brk-instructions-in-lldb-on-aarch64

@janvorli
Copy link
Member

janvorli commented Oct 4, 2024

I will try to make such a change and see.

@janvorli
Copy link
Member

janvorli commented Oct 4, 2024

That worked! I am going to create a PR with a fix

@janvorli janvorli self-assigned this Oct 4, 2024
janvorli added a commit to janvorli/runtime that referenced this issue Oct 4, 2024
Currently we use brk #0, but lldb cannot step over it. Using brk #0xf000 instead
works fine.

Close dotnet#108541
@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Oct 4, 2024
@tommcdon tommcdon added this to the 10.0.0 milestone Oct 7, 2024
@tommcdon tommcdon removed the untriaged New issue has not been triaged by the area owner label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Diagnostics-coreclr in-pr There is an active PR which will close this issue when it is merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants