NAME=dbg.stepback
FILE=bins/elf/analysis/ls-linux-x86_64-zlul
ARGS=-d -e dbg.bpsysign=true
CMDS=<<EOF
db main
db 0x004028fe
dc
dts+
dc
dsb
dsb
dr rbx,rcx,r12,rip
dk 9
EOF
EXPECT=<<EOF
0x00000001
0x736c6974756572
0x00404870
0x004028f9
EOF
RUN

NAME=debug stepback from callee
FILE=bins/elf/analysis/calls_x64
ARGS=-d
CMDS=<<EOF
db main
db 0x0040052f
dc
dts+
dc
dr rax,rbx,rcx,r10,rbp,rip
dsb
dsb
dr rax,rbx,rcx,r10,rbp,rip
dk 9
EOF
EXPECT=<<EOF
0x00400574
0x00400590
0x00400590
0xfffffffffffff30e
0x00000000
0x0040052f
0x00400574
0x00400590
0x00400590
0xfffffffffffff30e
0x00000000
0x00400575
EOF
RUN

NAME=debug stepback from caller
FILE=bins/elf/analysis/calls_x64
ARGS=-d -e dbg.bpsysign=true
CMDS=<<EOF
db main
db 0x0040057c
dc
dts+
dc
dsb
dsb
dr rip
EOF
EXPECT=<<EOF
0x0040053b
EOF
RUN
