mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 20:14:27 +01:00
run: --tmux-args implies --tmux
This commit is contained in:
11
README.adoc
11
README.adoc
@@ -968,7 +968,7 @@ This automatically clears the GDB pane, and starts a new one.
|
|||||||
Pass extra GDB arguments with:
|
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:
|
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 \
|
./run \
|
||||||
--arch aarch64 \
|
--arch aarch64 \
|
||||||
--userland print_argv \
|
--userland print_argv \
|
||||||
--tmux \
|
|
||||||
--tmux-args main \
|
--tmux-args main \
|
||||||
--wait-gdb \
|
--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:
|
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`:
|
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:
|
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>>:
|
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[].
|
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.:
|
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.
|
The cool thing about those examples is that you start at the very first instruction of your program, which gives more control.
|
||||||
|
|||||||
@@ -518,7 +518,7 @@ Use gem5 instead of QEMU. Shortcut for `--emulator gem5`.
|
|||||||
env['rootfs_raw_file'] = env['buildroot_rootfs_raw_file']
|
env['rootfs_raw_file'] = env['buildroot_rootfs_raw_file']
|
||||||
env['qcow2_file'] = env['buildroot_qcow2_file']
|
env['qcow2_file'] = env['buildroot_qcow2_file']
|
||||||
|
|
||||||
# Image.
|
# Image
|
||||||
if env['baremetal'] is None:
|
if env['baremetal'] is None:
|
||||||
if env['emulator'] == 'gem5':
|
if env['emulator'] == 'gem5':
|
||||||
env['image'] = env['vmlinux']
|
env['image'] = env['vmlinux']
|
||||||
@@ -547,8 +547,10 @@ Use gem5 instead of QEMU. Shortcut for `--emulator gem5`.
|
|||||||
env['source_path'] = source_path
|
env['source_path'] = source_path
|
||||||
break
|
break
|
||||||
env['image'] = path
|
env['image'] = path
|
||||||
|
|
||||||
self.env = env
|
self.env = env
|
||||||
|
|
||||||
|
|
||||||
def add_argument(self, *args, **kwargs):
|
def add_argument(self, *args, **kwargs):
|
||||||
shortname, longname, key, is_option = self.get_key(*args, **kwargs)
|
shortname, longname, key, is_option = self.get_key(*args, **kwargs)
|
||||||
if key in self._defaults:
|
if key in self._defaults:
|
||||||
|
|||||||
6
run
6
run
@@ -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
|
Pass an extra Linux kernel command line options, and place them before
|
||||||
the dash separator `-`. Only options that come before the `-`, i.e.
|
the dash separator `-`. Only options that come before the `-`, i.e.
|
||||||
"standard" options, should be passed with this option.
|
"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(
|
self.add_argument(
|
||||||
@@ -178,7 +178,7 @@ to use this option:
|
|||||||
self.add_argument(
|
self.add_argument(
|
||||||
'--tmux-args',
|
'--tmux-args',
|
||||||
help='''\
|
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(
|
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:
|
if self.env['baremetal'] is None:
|
||||||
cmd.extend(append)
|
cmd.extend(append)
|
||||||
|
if self.env['tmux_args'] is not None:
|
||||||
|
self.env['tmux'] = True
|
||||||
if self.env['tmux']:
|
if self.env['tmux']:
|
||||||
tmux_args = '--run-id {}'.format(self.env['run_id'])
|
tmux_args = '--run-id {}'.format(self.env['run_id'])
|
||||||
if self.env['emulator'] == 'gem5':
|
if self.env['emulator'] == 'gem5':
|
||||||
|
|||||||
Reference in New Issue
Block a user