diff options
Diffstat (limited to 'pintos-progos/utils/pintos-gdb')
| -rwxr-xr-x | pintos-progos/utils/pintos-gdb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pintos-progos/utils/pintos-gdb b/pintos-progos/utils/pintos-gdb new file mode 100755 index 0000000..9c9555b --- /dev/null +++ b/pintos-progos/utils/pintos-gdb | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #! /bin/sh | ||
| 2 | |||
| 3 | # Path to GDB macros file. Customize for your site. | ||
| 4 | PINTOS_SRC="$(dirname $(dirname $(which pintos-gdb)))" | ||
| 5 | GDBMACROS="${PINTOS_SRC}/misc/gdb-macros" | ||
| 6 | |||
| 7 | # Choose correct GDB. | ||
| 8 | if command -v i386-elf-gdb >/dev/null 2>&1; then | ||
| 9 | GDB=i386-elf-gdb | ||
| 10 | else | ||
| 11 | GDB=gdb | ||
| 12 | fi | ||
| 13 | |||
| 14 | # Run GDB. | ||
| 15 | if test -f "$GDBMACROS"; then | ||
| 16 | exec $GDB -x "$GDBMACROS" "$@" | ||
| 17 | else | ||
| 18 | echo "*** $GDBMACROS does not exist ***" | ||
| 19 | echo "*** Pintos GDB macros will not be available ***" | ||
| 20 | exec $GDB "$@" | ||
| 21 | fi | ||
