mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
Don't pass all arguments explicitly, just use existing vars. Prefix all common_setup inputs and outputs with common_ to avoid name conflicts.
26 lines
574 B
Bash
Executable File
26 lines
574 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eu
|
|
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
|
set -- ${cli_rungdbserver:-} "$@"
|
|
while getopts a:g OPT; do
|
|
case "$OPT" in
|
|
a)
|
|
common_arch="$OPTARG"
|
|
;;
|
|
g)
|
|
common_gem5=true
|
|
;;
|
|
esac
|
|
done
|
|
shift "$(($OPTIND - 1))"
|
|
executable="$1"
|
|
common_setup
|
|
"${common_host_dir}/usr/bin/${common_arch}-linux-gdb" \
|
|
-q \
|
|
-ex "set sysroot ${common_buildroot_out_dir}/staging" \
|
|
-ex "target remote localhost:${common_qemu_hostfwd_generic_port}" \
|
|
-ex 'tb main' \
|
|
-ex 'c' \
|
|
"${common_build_dir}/${executable}" \
|
|
;
|