NAME=spawn + attach and suspend
FILE=bins/mach0/hello-macos-arm64
ARGS=-d
CMDS=<<EOF
# when spawning the process ourselves, it should be
# suspended right away and stop at the entry in dyld.
# This is a bit hard to check automatically, so let's
# just make sure pc is in a map of dyld even after sleeping.
!sleep 0.5
dm @ pc~*~[9]
EOF
EXPECT=<<EOF
/usr/lib/dyld
EOF
RUN

NAME=dcu + read
FILE=bins/mach0/hello-macos-arm64
ARGS=-d
CMDS=<<EOF
dcu main
pi 8 @ pc
EOF
EXPECT=<<EOF
sub sp, sp, 0x50
stp x29, x30, [sp, 0x40]
add x29, sp, 0x40
adrp x8, reloc.NSLog
add x8, x8, 0x180
stur w0, [x29, -4]
stur x1, [x29, -0x10]
str x8, [sp, 0x10]
EOF
RUN

