mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
bak
This commit is contained in:
19
rungdb
19
rungdb
@@ -2,13 +2,20 @@
|
||||
|
||||
set -e
|
||||
|
||||
arch=x86_64
|
||||
arch='x86_64'
|
||||
bdfore=''
|
||||
kgdb=false
|
||||
while getopts a:k OPT; do
|
||||
while getopts A:a:b:k OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
arch="$OPTARG"
|
||||
;;
|
||||
A)
|
||||
after="$OPTARG"
|
||||
;;
|
||||
b)
|
||||
before="$OPTARG"
|
||||
;;
|
||||
k)
|
||||
kgdb=true
|
||||
;;
|
||||
@@ -17,13 +24,14 @@ done
|
||||
shift "$(($OPTIND - 1))"
|
||||
if [ "$#" -gt 0 ]; then
|
||||
brk="-ex 'break $1'"
|
||||
shift
|
||||
else
|
||||
brk=''
|
||||
fi
|
||||
|
||||
buildroot_out_dir="$(pwd)/buildroot/output.${arch}~"
|
||||
gdb="${buildroot_out_dir}/host/usr/bin/${arch}-linux-gdb"
|
||||
cd "${buildroot_out_dir}/build"/linux-custom/
|
||||
gdb="${buildroot_out_dir}/host/usr/bin/${arch}-linux-gdb $before"
|
||||
cd "${buildroot_out_dir}/build/linux-custom/"
|
||||
if "$kgdb"; then
|
||||
cmd="$gdb \
|
||||
-q \
|
||||
@@ -48,7 +56,7 @@ else
|
||||
-ex 'disconnect' \
|
||||
-ex 'set arch i386:x86-64' \
|
||||
-ex 'target remote localhost:1234' \
|
||||
-ex 'lx-symbols ../kernel_module-1.0/'
|
||||
-ex 'lx-symbols ../kernel_module-1.0/' \
|
||||
"
|
||||
;;
|
||||
'arm'|'aarch64'|'mips64')
|
||||
@@ -63,5 +71,6 @@ else
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
cmd="$cmd $after"
|
||||
echo "$cmd"
|
||||
eval "$cmd"
|
||||
|
||||
Reference in New Issue
Block a user