| 1 | #!/bin/sh |
| 2 | # Line numbers for gdb: stops a test program at a line of its source, |
| 3 | # by file and line, and checks that gdb names it, and the line of each |
| 4 | # caller. |
| 5 | out=build/check |
| 6 | mkdir -p $out |
| 7 | ./raz -I conform/run/mods -o $out/Procs conform/run/Procs.raz || exit 1 |
| 8 | gdb -batch -ex 'break conform/run/Procs.raz:13' -ex run -ex bt $out/Procs > $out/gdb.out 2>&1 |
| 9 | for want in 'Breakpoint 1, Procs.odd () at conform/run/Procs.raz:13' \ |
| 10 | 'in Procs.even () at conform/run/Procs.raz:20' \ |
| 11 | 'in Procs.main () at conform/run/Procs.raz:'; do |
| 12 | if ! grep -qF "$want" $out/gdb.out; then |
| 13 | echo "FAIL gdb: no \"$want\""; cat $out/gdb.out; exit 1 |
| 14 | fi |
| 15 | done |
| 16 | echo "gdb finds the lines" |