Document gem5 userland debugging

This lead to an infinite chaing of refactorings:

Fix arm and aarch64 lx-symbols

This was just by chance, a continue GDB command was needed before running it.

I noticed that there is no more need for the x86 GDB --ex 'set arch i386:x86-64:intel'
thing and unified all archs. TODO bisect where that was fixed and understand why.

Add debug kernel configs for gem5 kernel.

Document gem5 aarch64 gdb debug doesn't work.

Document tmux split pane action.
This commit is contained in:
Ciro Santilli
2018-03-23 14:46:53 +00:00
parent 29908dffb2
commit 6e9f3dcf23
6 changed files with 323 additions and 188 deletions

11
run
View File

@@ -6,6 +6,7 @@ set -e
arch=x86_64
cpus=1
debug_vm=''
debug=false
kgdb=false
kvm=false
# norandmaps: Don't use address space randomization. Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space.
@@ -36,7 +37,8 @@ while getopts a:c:DdE:e:f:G:gIiKkm:nt:x OPT; do
debug_vm='gdb -q -ex start --args'
;;
d)
extra_flags_qemu="$extra_flags_qemu -S -s"
debug=true
extra_flags_qemu="$extra_flags_qemu -S"
;;
E)
lkmc_eval="$OPTARG"
@@ -84,6 +86,10 @@ done
shift "$(($OPTIND - 1))"
extra_flags="$extra_flags $@"
set_common_vars "$arch" "$gem5"
if "$debug" && "$kvm"; then
echo 'error: -d and -K are incompatible' 1>&2
exit 1
fi
if "$initrd" || "$initramfs"; then
ramfs=true
else
@@ -159,10 +165,11 @@ else
qemu_common="\
${debug_vm} \
'${out_dir}/host/usr/bin/qemu-system-${arch}' \
-gdb tcp::1234 \
-m ${memory} \
-monitor telnet::45454,server,nowait \
-netdev user,hostfwd=tcp::45455-:45455,id=net0 \
-smp $cpus \
-smp ${cpus} \
-virtfs local,path=9p,mount_tag=host_scratch,security_model=mapped,id=host_scratch \
-virtfs local,path=${out_dir}/build,mount_tag=host_out,security_model=mapped,id=host_out \
"