1# connect gdb to Valgrind gdbserver: 2target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcblocklistsearch 3echo vgdb launched process attached\n 4monitor v.set vgdb-error 999999 5# 6# 7# insert break after the allocation of A 8break leak-tree.c:42 9# insert break after returning from function f 10break leak-tree.c:67 11# 12# continue till //1break: 13continue 14# save the value of A 15set $0xA = t 16# 17# continue till 2nd break 18continue 19# 20# check who points at A 21eval "monitor who_points_at 0x%lx 1", $0xA 22# do a leak check, and then list the blocks lost 23echo full leak search \n 24monitor leak_check full reachable any 25# 26echo block list 6 D \n 27monitor block_list 6 28echo block list 7 C F G \n 29monitor block_list 7 30monitor v.kill 31quit 32