raz / test / lldb.sh

17 lines · 769 B · executable · raw · history · last change b6a29ae3

1#!/bin/sh
2# Line numbers for lldb, as gdb.sh's for gdb, on a Mac: stops a test
3# program at a line of its source, by file and line, and checks that
4# lldb names it, and the line of each caller. The program is conform's
5# Procs, which test/mac.sh build made for darwin-arm64 in build/mac.
6prog=build/mac/conform/Procs
7out=build/mac
8if [ ! -x $prog ]; then echo "FAIL lldb: no $prog; make mac-build first"; exit 1; fi
9lldb --batch -o 'b Procs.raz:13' -o run -o bt $prog > $out/lldb.out 2>&1
10for want in 'Procs.odd at Procs.raz:13' \
11 'Procs.even at Procs.raz:20' \
12 'Procs.main at Procs.raz:'; do
13 if ! grep -qF "$want" $out/lldb.out; then
14 echo "FAIL lldb: no \"$want\""; cat $out/lldb.out; exit 1
15 fi
16done
17echo "lldb finds the lines"