run: --tmux-args implies --tmux

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-01-22 00:00:00 +00:00
parent f2e73bac83
commit 4ae3dea975
3 changed files with 12 additions and 9 deletions

View File

@@ -968,7 +968,7 @@ This automatically clears the GDB pane, and starts a new one.
Pass extra GDB arguments with:
....
./run --wait-gdb --tmux --tmux-args start_kernel
./run --wait-gdb --tmux-args start_kernel
....
See the tmux manual for further details:
@@ -2994,7 +2994,6 @@ Or alternatively, if you are using <<tmux>>, do everything in one go with:
./run \
--arch aarch64 \
--userland print_argv \
--tmux \
--tmux-args main \
--wait-gdb \
-- \
@@ -5127,7 +5126,7 @@ If `CONFIG_KALLSYMS=n`, then addresses are shown on traces instead of symbol plu
In v4.16 it does not seem possible to configure that at runtime. GDB step debugging with:
....
./run --eval-after 'insmod /dump_stack.ko' --wait-gdb --tmux --tmux-args dump_stack
./run --eval-after 'insmod /dump_stack.ko' --wait-gdb --tmux-args dump_stack
....
shows that traces are printed at `arch/x86/kernel/dumpstack.c`:
@@ -10350,13 +10349,13 @@ then on the second shell:
Or if you are a <<tmux,tmux pro>>, do everything in one go with:
....
./run --arch arm --baremetal interactive/prompt --wait-gdb --tmux --tmux-args main
./run --arch arm --baremetal interactive/prompt --wait-gdb --tmux-args main
....
Alternatively, to start from the very first executed instruction of our tiny <<baremetal-bootloaders>>:
....
./run --arch arm --baremetal interactive/prompt --wait-gdb --tmux --tmux-args --no-continue
./run --arch arm --baremetal interactive/prompt --wait-gdb --tmux-args --no-continue
....
Now you can just `stepi` to when jumping into main to go to the C code in link:baremetal/interactive/prompt.c[].
@@ -10364,7 +10363,7 @@ Now you can just `stepi` to when jumping into main to go to the C code in link:b
This is specially interesting for the executables that don't use the bootloader from under `baremetal/arch/<arch>/no_bootloader/*.S`, e.g.:
....
./run --arch arm --baremetal arch/arm/no_bootloader/semihost_exit --wait-gdb --tmux --tmux-args --no-continue
./run --arch arm --baremetal arch/arm/no_bootloader/semihost_exit --wait-gdb --tmux-args --no-continue
....
The cool thing about those examples is that you start at the very first instruction of your program, which gives more control.

View File

@@ -518,7 +518,7 @@ Use gem5 instead of QEMU. Shortcut for `--emulator gem5`.
env['rootfs_raw_file'] = env['buildroot_rootfs_raw_file']
env['qcow2_file'] = env['buildroot_qcow2_file']
# Image.
# Image
if env['baremetal'] is None:
if env['emulator'] == 'gem5':
env['image'] = env['vmlinux']
@@ -547,8 +547,10 @@ Use gem5 instead of QEMU. Shortcut for `--emulator gem5`.
env['source_path'] = source_path
break
env['image'] = path
self.env = env
def add_argument(self, *args, **kwargs):
shortname, longname, key, is_option = self.get_key(*args, **kwargs)
if key in self._defaults:

6
run
View File

@@ -64,7 +64,7 @@ See: https://github.com/cirosantilli/linux-kernel-module-cheat#replace-init
Pass an extra Linux kernel command line options, and place them before
the dash separator `-`. Only options that come before the `-`, i.e.
"standard" options, should be passed with this option.
Example: `./run -a arm -e 'init=/poweroff.out'`
Example: `./run --arch arm --kernel-cli 'init=/poweroff.out'`
'''
)
self.add_argument(
@@ -178,7 +178,7 @@ to use this option:
self.add_argument(
'--tmux-args',
help='''\
Parameters to pass to the program running on the tmux split.
Parameters to pass to the program running on the tmux split. Implies --tmux.
'''
)
self.add_argument(
@@ -559,6 +559,8 @@ Run QEMU with VNC instead of the default SDL. Connect to it with:
)
if self.env['baremetal'] is None:
cmd.extend(append)
if self.env['tmux_args'] is not None:
self.env['tmux'] = True
if self.env['tmux']:
tmux_args = '--run-id {}'.format(self.env['run_id'])
if self.env['emulator'] == 'gem5':