GEM5 vm GDB debug

This commit is contained in:
Ciro Santilli
2018-02-22 08:35:11 +00:00
parent e4dde335ed
commit 80e299850d
2 changed files with 9 additions and 8 deletions

View File

@@ -371,7 +371,7 @@ When you start interacting with QEMU hardware, it is useful to see what is going
This is of course trivial since QEMU is just an userland program on the host, but we make it a bit easier with: This is of course trivial since QEMU is just an userland program on the host, but we make it a bit easier with:
.... ....
./run -q ./run -D
.... ....
Then you could: Then you could:
@@ -1361,7 +1361,7 @@ Related threads:
===== GEM5 x86 best attempt ===== GEM5 x86 best attempt
.... ....
./configure && ./build -a x86_64-gem5 ./configure && ./build -a x86_64 -g
./run -a x86_64 -g ./run -a x86_64 -g
.... ....

13
run
View File

@@ -4,7 +4,7 @@ set -e
# CLI handling. # CLI handling.
arch=x86_64 arch=x86_64
debug_qemu='' debug_vm=''
kgdb=false kgdb=false
nographic=false nographic=false
# norandmaps: Don't use address space randomization. Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space. # norandmaps: Don't use address space randomization. Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space.
@@ -16,7 +16,7 @@ extra_flags=''
gem5=false gem5=false
initrd=false initrd=false
root='' root=''
while getopts a:de:giknqt:x OPT; do while getopts a:Dde:giknt:x OPT; do
case "$OPT" in case "$OPT" in
a) a)
arch="$OPTARG" arch="$OPTARG"
@@ -24,6 +24,9 @@ while getopts a:de:giknqt:x OPT; do
d) d)
extra_flags="$extra_flags -S -s" extra_flags="$extra_flags -S -s"
;; ;;
D)
debug_vm='gdb -q -ex start --args'
;;
e) e)
extra_append="$extra_append $OPTARG" extra_append="$extra_append $OPTARG"
;; ;;
@@ -45,9 +48,6 @@ while getopts a:de:giknqt:x OPT; do
extra_flags="$extra_flags -nographic" extra_flags="$extra_flags -nographic"
nographic=true nographic=true
;; ;;
q)
debug_qemu='gdb -q -ex start --args'
;;
esac esac
done done
shift "$(($OPTIND - 1))" shift "$(($OPTIND - 1))"
@@ -68,6 +68,7 @@ M5_PATH='$(pwd)/gem5/gem5-system' \
elif [ "$arch" = arm ]; then elif [ "$arch" = arm ]; then
cmd="\ cmd="\
M5_PATH='$(pwd)/gem5/gem5-system' \ M5_PATH='$(pwd)/gem5/gem5-system' \
$debug_vm \
'${gem5_dir}/build/ARM/gem5.opt' \ '${gem5_dir}/build/ARM/gem5.opt' \
'${gem5_dir}/configs/example/fs.py' \ '${gem5_dir}/configs/example/fs.py' \
--command-line='earlyprintk=pl011,0x1c090000 console=ttyAMA0 lpj=19988480 norandmaps rw loglevel=8 mem=512MB root=/dev/sda $extra_append' \ --command-line='earlyprintk=pl011,0x1c090000 console=ttyAMA0 lpj=19988480 norandmaps rw loglevel=8 mem=512MB root=/dev/sda $extra_append' \
@@ -82,7 +83,7 @@ else
buildroot_out_dir="./buildroot/output.${arch}~" buildroot_out_dir="./buildroot/output.${arch}~"
images_dir="$buildroot_out_dir/images" images_dir="$buildroot_out_dir/images"
qemu_common="\ qemu_common="\
$debug_qemu \ $debug_vm \
$buildroot_out_dir/host/usr/bin/qemu-system-${arch} \ $buildroot_out_dir/host/usr/bin/qemu-system-${arch} \
-m 128M \ -m 128M \
-monitor telnet::45454,server,nowait \ -monitor telnet::45454,server,nowait \