1# connect gdb to Valgrind gdbserver: 2target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcbreak 3echo vgdb launched process attached\n 4monitor v.set vgdb-error 999999 5# 6define checkstep 7 set $old_pc=$pc 8 step 9 if $old_pc == $pc 10 echo Bizarre the oldpc has not changed after step\n 11 print $oldpc 12 print $pc 13 else 14 echo old_pc has changed after step\n 15 end 16end 17# 18# break1 and break2 19break t.c:112 20break t.c:117 21# 22continue 23# first break encountered. 24checkstep 25checkstep 26checkstep 27# 28monitor v.set vgdb-error 0 29# 30next 31print whoami("first") 32print undefined 33print i 34checkstep 35checkstep 36next 37print whoami("second") 38print undefined 39print i 40next 41print whoami("third") 42print undefined 43print i 44next 45print whoami("fourth") 46print undefined 47print i 48# modify sleeps so as to have a shorter test: 49print sleeps=1 50# 51print whoami("after next: inferior call pushed from mcbreak.stdinB.gdb") 52continue 53# 54# encountered second break 55step 56finish 57# delete all breaks 58delete 59continue 60monitor v.info n_errs_found 61# inferior call "in the middle" of an instruction is not working at least 62# on all platforms, so comment the below. 63# print whoami("after error: inferior call pushed from mcbreak.stdinB.gdb") 64checkstep 65monitor v.set vgdb-error 0 66continue 67# stop the process a.o. to avoid non deterministic output 68monitor v.kill 69quit 70