mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
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:
10
rungdb-user
10
rungdb-user
@@ -4,6 +4,7 @@ set -eu
|
||||
usage="$0 <exec-relative-path> [<brk-symbol>]"
|
||||
arch='x86_64'
|
||||
gem5=false
|
||||
gem5_opt=''
|
||||
while getopts a:gh OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
@@ -11,6 +12,7 @@ while getopts a:gh OPT; do
|
||||
;;
|
||||
g)
|
||||
gem5=true
|
||||
gem5_opt=-g
|
||||
;;
|
||||
h)
|
||||
echo "$usage"
|
||||
@@ -32,7 +34,11 @@ executable="${out_dir}/build/${executable_rel}"
|
||||
readelf="${out_dir}/host/usr/bin/${arch}-linux-readelf"
|
||||
addr="$("$readelf" -h "$executable" | awk '/Entry/{ print $NF }' )"
|
||||
ex="-ex \"add-symbol-file $executable $addr\""
|
||||
# Twice because lx-symbols overrides our add-symbol-file commands.
|
||||
cmd="./rungdb -b '$ex' -A '$ex' $brk"
|
||||
# -L or else lx-symbols throws for arm:
|
||||
# gdb.MemoryError: Cannot access memory at address 0xbf0040cc
|
||||
# TODO understand better.
|
||||
#
|
||||
# Also, lx-symbols overrides the add-symbol-file commands.
|
||||
cmd="./rungdb -a '${arch}' -b '${ex}' ${gem5_opt} -L ${brk}"
|
||||
echo "$cmd"
|
||||
eval "$cmd"
|
||||
|
||||
Reference in New Issue
Block a user