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-mcclean_after_fork |
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 | # put a break in main, and then a watch |
| 7 | # also put breaks in code that only the child will execute. |
| 8 | # These breaks should not be encountered. |
| 9 | break clean_after_fork.c:9 |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 10 | break clean_after_fork.c:20 |
sewardj | 45fa417 | 2011-06-26 09:13:27 +0000 | [diff] [blame] | 11 | break clean_after_fork.c:22 |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 12 | # |
| 13 | continue |
| 14 | # first break encountered. |
| 15 | # put a read watchpoint on mem |
| 16 | # we expect that the read watchpoint is not triggered in the child |
| 17 | # (as we expect it will be cleared at fork). |
| 18 | rwatch mem |
| 19 | # |
| 20 | continue |
| 21 | # |
| 22 | # we should now have encountered the read watchpoint in the parent. |
| 23 | # let's kill the parent: |
sewardj | 30b3eca | 2011-06-28 08:20:39 +0000 | [diff] [blame] | 24 | monitor v.kill |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 25 | quit |