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