Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Misleading debug info on AArch64 #52651

Copy link
Copy link
Closed
@ElvinaYakubova

Description

@ElvinaYakubova
Issue body actions

https://godbolt.org/z/36jshbhYh

int main() { 
    int a = 2;
}

compiled with clang produces such code:

main:                                   // @main
        sub     sp, sp, #16
        mov     w8, #2
        str     w8, [sp, #12]
        mov     w0, wzr
        add     sp, sp, #16
        ret

I've noticed while parsing binary with debug info (which was compiled with clang), that if we have a variable assignment, mov instruction refers to the previous block, and block with assignment starts only with str instruction on AArch64 (you can see this yellow block from the godbolt link).
The same, if you try to set a breakpoint on the second line in gdb it will jump to the str, skipping mov. GCC produces the correct result, block starts with mov instruction.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.