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 |
sewardj | eefeeb7 | 2011-05-10 11:01:07 +0000 | [diff] [blame] | 3 | echo vgdb launched process attached\n |
sewardj | 30b3eca | 2011-06-28 08:20:39 +0000 | [diff] [blame] | 4 | monitor v.set vgdb-error 999999 |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 5 | # |
| 6 | define 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 |
| 16 | end |
| 17 | # |
| 18 | # break1 and break2 |
| 19 | break t.c:112 |
| 20 | break t.c:117 |
| 21 | # |
| 22 | continue |
| 23 | # first break encountered. |
| 24 | checkstep |
| 25 | checkstep |
| 26 | checkstep |
| 27 | # |
sewardj | 30b3eca | 2011-06-28 08:20:39 +0000 | [diff] [blame] | 28 | monitor v.set vgdb-error 0 |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 29 | # |
| 30 | next |
| 31 | print whoami("first") |
| 32 | print undefined |
| 33 | print i |
| 34 | checkstep |
| 35 | checkstep |
| 36 | next |
| 37 | print whoami("second") |
| 38 | print undefined |
| 39 | print i |
| 40 | next |
| 41 | print whoami("third") |
| 42 | print undefined |
| 43 | print i |
| 44 | next |
| 45 | print whoami("fourth") |
| 46 | print undefined |
| 47 | print i |
| 48 | # modify sleeps so as to have a shorter test: |
| 49 | print sleeps=1 |
| 50 | # |
| 51 | print whoami("after next: inferior call pushed from mcbreak.stdinB.gdb") |
| 52 | continue |
| 53 | # |
| 54 | # encountered second break |
| 55 | step |
| 56 | finish |
| 57 | # delete all breaks |
| 58 | delete |
| 59 | continue |
sewardj | 30b3eca | 2011-06-28 08:20:39 +0000 | [diff] [blame] | 60 | monitor v.info n_errs_found |
philippe | 02ea413 | 2013-09-04 21:42:43 +0000 | [diff] [blame^] | 61 | monitor v.info n_errs_found a |
| 62 | monitor v.info n_errs_found b |
| 63 | monitor v.info n_errs_found c d |
| 64 | monitor v.info n_errs_found eeeeeee fffffff ggggggg |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 65 | # inferior call "in the middle" of an instruction is not working at least |
| 66 | # on all platforms, so comment the below. |
| 67 | # print whoami("after error: inferior call pushed from mcbreak.stdinB.gdb") |
| 68 | checkstep |
sewardj | 30b3eca | 2011-06-28 08:20:39 +0000 | [diff] [blame] | 69 | monitor v.set vgdb-error 0 |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 70 | continue |
| 71 | # stop the process a.o. to avoid non deterministic output |
sewardj | 30b3eca | 2011-06-28 08:20:39 +0000 | [diff] [blame] | 72 | monitor v.kill |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 73 | quit |