blob: a1549256176e21d551e3c2ae4d75ee39f0890f4d [file] [log] [blame]
sewardj3b290482011-05-06 21:02:55 +00001# connect gdb to Valgrind gdbserver:
2target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcbreak
3monitor vg.set vgdb-error 999999
4#
5define 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
15end
16#
17# break1 and break2
18break t.c:112
19break t.c:117
20#
21continue
22# first break encountered.
23checkstep
24checkstep
25checkstep
26#
27monitor vg.set vgdb-error 0
28#
29next
30print whoami("first")
31print undefined
32print i
33checkstep
34checkstep
35next
36print whoami("second")
37print undefined
38print i
39next
40print whoami("third")
41print undefined
42print i
43next
44print whoami("fourth")
45print undefined
46print i
47# modify sleeps so as to have a shorter test:
48print sleeps=1
49#
50print whoami("after next: inferior call pushed from mcbreak.stdinB.gdb")
51continue
52#
53# encountered second break
54step
55finish
56# delete all breaks
57delete
58continue
59monitor 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")
63checkstep
64monitor vg.set vgdb-error 0
65continue
66# stop the process a.o. to avoid non deterministic output
67monitor vg.kill
68quit