]> git.sthu.org Git - vimconf.git/blob - gdb.sh
dis: Fix label matching
[vimconf.git] / gdb.sh
1 #!/bin/sh
2
3 set -eu
4
5 GDBBIN="gdb"
6 GDBARGS=""
7 WITH_DASHBOARD=0
8
9 # If gdb-dashboard is installed, use it
10 if command -v gdb-dashboard &> /dev/null; then
11 GDBBIN="gdb-dashboard"
12 WITH_DASHBOARD=1
13 fi
14
15 # Check if gdbinit ships gdb-dashboard
16 if [ -e ~/.gdbinit ] && grep -q dashboard ~/.gdbinit; then
17 WITH_DASHBOARD=1
18 fi
19
20 # If we use dashboard then pass corresponding gdbinit file
21 if [ "${WITH_DASHBOARD}" = "1" ]; then
22 GDBARGS="${GDBARGS} -x ~/.vim/gdbinit-dashboard"
23 fi
24
25 exec ${GDBBIN} ${GDBARGS} "$@"