xref: /llvm-project/lldb/test/Shell/Unwind/Inputs/thread-step-out-ret-addr-check.s (revision e192cc1f1bf120712f7c78fcd51645db8918d083)
1        .text
2        .globl  asm_main
3asm_main:
4        sub $0x8, %rsp
5        movq $0, (%rsp)
6        push %rsp
7        jmp nonstandard_stub
8
9# Takes a single pointer argument via the stack, which is nonstandard for x64.
10# Executing 'thread step-out' here will initially attempt to write a
11# breakpoint to that stack address, but should fail because of the executable
12# memory check.
13        .globl nonstandard_stub
14nonstandard_stub:
15        mov (%rsp), %rdi
16        mov (%rdi), %rsi
17        add $1, %rsi
18        mov %rsi, (%rdi)
19
20        add $0x10, %rsp
21        ret
22
23#ifdef __linux__
24        .section .note.GNU-stack,"",@progbits
25#endif
26