Files
linux-kernel-module-cheat/rungdb
2017-05-21 09:26:47 +01:00

21 lines
412 B
Bash
Executable File

#!/usr/bin/env bash
if [ "$#" -gt 0 ]; then
brk="-ex 'break $1'"
else
brk=""
fi
cd buildroot/output/build/linux-*.*.*/
cmd="gdb \
-q \
-ex 'add-auto-load-safe-path $(pwd)' \
-ex 'file vmlinux' \
-ex 'set arch i386:x86-64:intel' \
-ex 'target remote localhost:1234' \
$brk \
-ex 'continue' \
-ex 'disconnect' \
-ex 'set arch i386:x86-64' \
-ex 'target remote localhost:1234'
"
eval "$cmd"