run: add --userland-args to make userland arguments across QEMU and gem5

Get rid of --userland-before as a consequence.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-01-22 00:00:00 +00:00
parent 4ae3dea975
commit f388ad6460
3 changed files with 42 additions and 40 deletions

View File

@@ -2914,11 +2914,17 @@ First let's run a dynamically linked executable built with the Buildroot toolcha
./run \
--arch aarch64 \
--userland print_argv \
-- \
asdf qwer \
--userland-args 'asdf "qw er"' \
;
....
Output:
....
asdf
qw er
....
This runs link:userland/print_argv.c[]. `--userland` path resolution is analogous to <<baremetal-setup-getting-started,that of `./run --baremetal`>>.
`./build-userland` is further documented at: <<userland-directory>>.
@@ -2939,8 +2945,7 @@ You can also try statically linked executables with:
--arch aarch64 \
--userland-build-id static \
--userland print_argv \
-- \
asdf qwer \
--userland-args 'asdf "qw er"' \
;
....
@@ -2957,14 +2962,13 @@ Or you can run statically linked built by the host packaged toolchain with:
--arch aarch64 \
--userland-build-id host-static \
--userland print_argv \
-- \
asdf qwer \
--userland-args 'asdf "qw er"' \
;
....
TODO expose dynamically linked executables built by the host toolchain. It also works, we just have to use e.g. `-L /usr/aarch64-linux-gnu`, so it's not really hard, I'm just lazy.
==== QEMU user mode GDB
==== User mode GDB
It's nice when <<gdb,the obvious>> just works, right?
@@ -2972,9 +2976,8 @@ It's nice when <<gdb,the obvious>> just works, right?
./run \
--arch aarch64 \
--userland print_argv \
--userland-args 'asdf "qw er"' \
--wait-gdb \
-- \
asdf qwer \
;
....
@@ -2993,11 +2996,10 @@ Or alternatively, if you are using <<tmux>>, do everything in one go with:
....
./run \
--arch aarch64 \
--userland print_argv \
--tmux-args main \
--userland print_argv \
--userland-args 'asdf "qw er"' \
--wait-gdb \
-- \
asdf qwer \
;
....
@@ -3035,28 +3037,25 @@ So let's just play with some static ones:
--arch aarch64 \
--gem5 \
--userland print_argv \
--userland-build-id static \
-- \
--options 'asdf "qw er"' \
--userland-args 'asdf "qw er"' \
;
....
TODO: how to escape spaces?
TODO: how to escape spaces on the command line arguments?
Step debug also works:
....
./run \
--arch arm \
--wait-gdb \
--arch aarch64 \
--gem5 \
--userland print_argv \
--userland-args 'asdf "qw er"' \
--userland-build-id static \
-- \
--options 'asdf "qw er"' \
--wait-gdb \
;
./run-gdb \
--arch arm \
--arch aarch64 \
--gem5 \
--userland print_argv \
--userland-build-id static \
@@ -3108,10 +3107,8 @@ time \
./run \
--arch arm \
--gem5 \
--userland \
"$(./getvar --arch arm buildroot_build_build_dir)/dhrystone-2/dhrystone" \
-- \
--options 100000 \
--userland "$(./getvar --arch arm buildroot_build_build_dir)/dhrystone-2/dhrystone" \
--userland-args 'asdf qwer' \
;
....