NAME=dmhg/dmhga with memory dump
FILE=bins/heap/linux_glibc-2.30_x64.bin
ARGS=-n
CMDS=<<EOF
#re-map arena and [heap]
om 3 0x7ffff7f8a000 0x898 0x0 rw- arena
om 3 0x555555559000 0x3200 0x898 rw- [heap]

dmhga~?0x7ffff7f8a000
e dbg.glibc.tcache=0
dmhg~?allocated
e dbg.glibc.tcache=1
dmhg~?allocated
EOF
EXPECT=<<EOF
1
3
1
EOF
RUN

NAME=dmhgt with memory dump
FILE=bins/heap/linux_glibc-2.30_x64.bin
ARGS=-n
CMDS=<<EOF
#re-map arena and [heap]
om 3 0x7ffff7f8a000 0x898 0x0 rw- arena
om 3 0x555555559000 0x3200 0x898 rw- [heap]

e dbg.glibc.tcache=0
dmhgt~?Items[2]
e dbg.glibc.tcache=1
dmhgt~?Items[2]
EOF
EXPECT=<<EOF
0
1
EOF
RUN

NAME=dmhgl with memory dump
FILE=bins/heap/linux_glibc-2.30_x64.bin
ARGS=-n
CMDS=<<EOF
#re-map arena and [heap]
om 3 0x7ffff7f8a000 0x898 0x0 rw- arena
om 3 0x555555559000 0x3200 0x898 rw- [heap]

dmhgl~?0x7ffff7f8a000
e dbg.glibc.tcache=0
dmhgl~?0x555555559000
dmhgl~?0x555555559010
e dbg.glibc.tcache=1
dmhgl~?0x555555559000
dmhgl~?0x55555555c1a0
dmhgl~?0x55555555c1c0
EOF
EXPECT=<<EOF
1
2
1
1
1
1
EOF
RUN

NAME=dmhgc with memory dump
FILE=bins/heap/linux_glibc-2.30_x64.bin
ARGS=-n
CMDS=<<EOF
#re-map arena and [heap]
om 3 0x7ffff7f8a000 0x898 0x0 rw- arena
om 3 0x555555559000 0x3200 0x898 rw- [heap]
e dbg.glibc.tcache=1
dmhgc @ 0x555555559290~?0x20
dmhgc @ 0x555555559290~?0x555555559010
dmhgc @ 0x55555555c1a0~?0x1a0a
dmhgc @ 0x5555555592b0~?0x2ef0
EOF
EXPECT=<<EOF
1
1
1
1
EOF
RUN
