NAME=asm.trace
FILE=bins/mach0/main-loop
CMDS=<<EOF
af
e asm.var.summary=0
e asm.flags.inline=true
e asm.comments=false
e asm.trace=1
e dbg.trace=1
aeim
e asm.bytes=0
s main
30ds
pdf
EOF
EXPECT=<<EOF
            ;-- section.0.__TEXT.__text, entry0, sym._main:
/ 36: int main (int argc, char **argv, char **envp);
|           ; arg int argc @ x0
|           ; var int32_t var_8h @ sp+0x8
|           ; var int32_t var_ch @ sp+0xc
|           0x100003f84 01:0001      sub sp, sp, 0x10
|           0x100003f88 01:0002      str wzr, [var_ch]
|           0x100003f8c 01:0003      mov w8, 3
|           0x100003f90 01:0004      str w8, [var_8h]
|       ,=< 0x100003f94 01:0005      b 0x100003f98
|      .`-> 0x100003f98 07:001e      ldr w8, [var_8h]
|      :    ;-- pc:
|      :    0x100003f9c 06:001b      add w8, w8, 1
|      :    0x100003fa0 06:001c      str w8, [var_8h]
\      `==< 0x100003fa4 06:001d      b 0x100003f98
EOF
RUN

NAME=dt list formats
FILE=malloc://64
CMDS=<<EOF
e asm.arch=x86
e asm.bits=64
wx 90 @ 0x10
wx 90 @ 0x20
dtj
dt+ 0x10
dt+ 0x20
dtj
dt*
dtq
dt
EOF
EXPECT=<<EOF
{"tag":0,"traces":[]}
{"tag":0,"traces":[{"addr":16,"tag":0,"times":1,"count":16,"size":1},{"addr":32,"tag":0,"times":1,"count":32,"size":1}]}
dt+ 0x10 1
dt+ 0x20 1
0x10
0x20
0x00000010 size=1 count=16 times=1 tag=0
0x00000020 size=1 count=32 times=1 tag=0
EOF
RUN
