gdbserver: get back to life

run-gdbserver is dead, converted to ./run --gdbserver --userland

I'm so happy, this refactor was so easy due to previous good code structure.

Fix https://github.com/cirosantilli/linux-kernel-module-cheat/issues/63
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-06-02 00:00:04 +00:00
parent 7fda133215
commit 39de6f6abf
3 changed files with 42 additions and 44 deletions

View File

@@ -2588,10 +2588,10 @@ First build `gdbserver` into the root filesystem:
./build-buildroot --config 'BR2_PACKAGE_GDB=y'
....
Then on guest, to debug link:userland/linux/myinsmod.c[]:
Then on guest, to debug link:userland/linux/rand_check.c[]:
....
./gdbserver.sh ./linux/myinsmod.out hello.ko
./gdbserver.sh ./c/print_argv.out asdf qwer
....
Source: link:rootfs_overlay/lkmc/gdbserver.sh[].
@@ -2599,13 +2599,13 @@ Source: link:rootfs_overlay/lkmc/gdbserver.sh[].
And on host:
....
./run-gdbserver userland/linux/myinsmod.c
./run-gdb --gdbserver --userland userland/c/print_argv.c main
....
or alternatively with the path to the executable itself:
....
./run-gdbserver "$(./getvar userland_build_dir)/linux/myinsmod.out"
./run --gdbserver --userland "$(./getvar userland_build_dir)/c/print_argv.out"
....
Bibliography: https://reverseengineering.stackexchange.com/questions/8829/cross-debugging-for-arm-mips-elf-with-qemu-toolchain/16214#16214
@@ -2621,7 +2621,7 @@ Analogous to <<gdb-step-debug-userland-processes>>:
on host you need:
....
./run-gdbserver "$(./getvar buildroot_build_build_dir)"/busybox-*/busybox ls_main
./run-gdb --gdbserver --userland "$(./getvar buildroot_build_build_dir)"/busybox-*/busybox ls_main
....
=== gdbserver libc
@@ -2631,13 +2631,13 @@ Our setup gives you the rare opportunity to step debug libc and other system lib
For example in the guest:
....
./gdbserver.sh ./count.out
./gdbserver.sh ./posix/count.out
....
Then on host:
....
./run-gdbserver count
./run-gdb --gdbserver --userland userland/posix/count.c main
....
and inside GDB:
@@ -3599,7 +3599,7 @@ Or alternatively, if you are using <<tmux>>, do everything in one go with:
;
....
To stop at the very first instruction of a freestanding program, just use `--no-continue` TODO example.
To stop at the very first instruction of a freestanding program, just use `--no-continue`. A good example of this is shown at: <<freestanding-programs>>.
=== User mode tests