blob: 4f932e6afe96ded2e27401704b164133d0798274 [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
sewardjeefeeb72011-05-10 11:01:07 +00003echo vgdb launched process attached\n
sewardj30b3eca2011-06-28 08:20:39 +00004monitor v.set vgdb-error 999999
sewardj3b290482011-05-06 21:02:55 +00005#
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#
sewardj30b3eca2011-06-28 08:20:39 +000028monitor v.set vgdb-error 0
sewardj3b290482011-05-06 21:02:55 +000029#
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
sewardj30b3eca2011-06-28 08:20:39 +000060monitor v.info n_errs_found
philippe02ea4132013-09-04 21:42:43 +000061monitor v.info n_errs_found a
62monitor v.info n_errs_found b
63monitor v.info n_errs_found c d
64monitor v.info n_errs_found eeeeeee fffffff ggggggg
sewardj3b290482011-05-06 21:02:55 +000065# 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")
68checkstep
sewardj30b3eca2011-06-28 08:20:39 +000069monitor v.set vgdb-error 0
sewardj3b290482011-05-06 21:02:55 +000070continue
71# stop the process a.o. to avoid non deterministic output
sewardj30b3eca2011-06-28 08:20:39 +000072monitor v.kill
sewardj3b290482011-05-06 21:02:55 +000073quit