NAME=dbg.oo 10
FILE=/bin/ls
ARGS=-d
BROKEN=1
CMDS=<<EOF
10oo
e file.path
EOF
EXPECT=<<EOF
dbg:///bin/ls
EOF
RUN

NAME=dbg.ood 10
FILE=/bin/ls
ARGS=-d
BROKEN=1
CMDS=<<EOF
10ood
e file.path
EOF
EXPECT=<<EOF
dbg:///bin/ls
EOF
RUN

NAME=ood after open in debug mode
FILE=bins/elf/analysis/x86-helloworld-gcc
ARGS=-d
CMDS=<<EOF
ood > $_
dc
ood > $_
dc
EOF
EXPECT=<<EOF
Hello world!
Hello world!
EOF
RUN

NAME=oo ; dc
FILE=bins/elf/analysis/x86-helloworld-gcc
ARGS=-d
CMDS=<<EOF
oo
dc
EOF
EXPECT=<<EOF
Hello world!
EOF
RUN

NAME=ood & om
FILE=bins/elf/analysis/x86-helloworld-gcc
ARGS=-d
CMDS=<<EOF
oml
echo
ood > /dev/null
oml
EOF
EXPECT=<<EOF
 1 fd: 3 +0x00000000 0x00000000 * 0x7ffffffffffffffe rwx 

 1 fd: 4 +0x00000000 0x00000000 * 0x7ffffffffffffffe rwx 
EOF
RUN

NAME=breakpoints after double ood
FILE=bins/elf/analysis/x86-helloworld-gcc
ARGS=
CMDS=<<EOF
db @ main
db @ main+3
ood > $_
dc # should hit the first breakpoint
.drf
%v eip-main
ood > $_
dc # should hit the first breakpoint
.drf
%v eip-main
dc # should hit the the second breakpoint
.drf
%v eip-main
EOF
EXPECT=<<EOF
0x0
0x0
0x3
EOF
RUN

NAME=dm flags after ood
FILE=bins/elf/analysis/x86-helloworld-gcc
ARGS=-e log.level=4
CMDS=<<EOF
. scripts/map_clean.rz
ood
fl@F:maps~?
.(fl_F_maps_clean)
EOF
EXPECT=<<EOF
10
0x08048000 4096 ..._rizin_test_bins_elf_analysis_x86_helloworld_gcc.r_x
0x08049000 4096 ..._rizin_test_bins_elf_analysis_x86_helloworld_gcc.rw
0x________ ____ vvar_.r
0x________ 8192 vvar_vclock_.r
0x________ ____ vdso_.r_x
0x________ 4096 usr_lib32_ld_linux.so.2.r
0x________ 143360 usr_lib32_ld_linux.so.2.r_x
0x________ 57344 usr_lib32_ld_linux.so.2.r.________
0x________ 12288 usr_lib32_ld_linux.so.2.rw
0x________ 1_____ stack_.rw
EOF
RUN

NAME=ood check for ptrace errors
FILE=bins/elf/analysis/x86-helloworld-gcc
CMDS=<<EOF
ood
EOF
REGEXP_FILTER_ERR=(Process\swith\sPID)|(helloworld-gcc\sreopened\sin\sread-write\smode)
EXPECT_ERR=<<EOF
Process with PID
helloworld-gcc reopened in read-write mode
EOF
RUN

NAME=ood/doc with spaced path
FILE=bins/elf/analysis/x86-helloworld-gcc
CMDS=<<EOF
cp `ol.t:uri:quiet` "space helloworld"
!chmod +x "space helloworld" #as cp drops it
o--
o "space helloworld"
ood > $_
doc > $_
ood > $_
dc
o--
rm "space helloworld"
EOF
EXPECT=<<EOF
Hello world!
EOF
RUN
