# Linux Kernel Module Cheat
The perfect emulation setup to study and develop the <<linux-kernel>> v5.9.2, kernel modules, <<qemu-buildroot-setup,QEMU>>, <<gem5-buildroot-setup,gem5>> and x86_64, ARMv7 and ARMv8 <<userland-assembly,userland>> and <<baremetal-setup,baremetal>> assembly, <<c,ANSI C>>, <<cpp,C++>> and <<posix,POSIX>>. <<gdb>> and <<kgdb>> just work. Powered by <<about-the-qemu-buildroot-setup,Buildroot>> and <<about-the-baremetal-setup,crosstool-NG>>. Highly automated. Thoroughly documented. Automated <<test-this-repo,tests>>.

#### 11.1.1. User mode GDB

It’s nice when the obvious just works, right?

    ./run \
      --arch aarch64 \
      --gdb-wait \
      --userland userland/c/command_line_arguments.c \
      --cli-args 'asdf "qw er"' \
    ;

and on another shell:

    ./run-gdb \
      --arch aarch64 \
      --userland userland/c/command_line_arguments.c \
      main \
    ;

Or alternatively, if you are using tmux, do everything in one go with:

    ./run \
      --arch aarch64 \
      --gdb \
      --userland userland/c/command_line_arguments.c \
      --cli-args 'asdf "qw er"' \
    ;

To stop at the very first instruction of a freestanding program, just use `--no-continue`. A good example of this is shown at: Section 28.5.1, “Freestanding programs”.