mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-22 17:55:57 +01:00
--debug-vm-ex for the win
This commit is contained in:
10
README.adoc
10
README.adoc
@@ -10149,12 +10149,20 @@ This is of course trivial since they are just regular userland programs on the h
|
||||
./run --debug-vm
|
||||
....
|
||||
|
||||
Or for a faster development loop:
|
||||
Or for a faster development loop you can pass `-ex` command as a semicolon separated list:
|
||||
|
||||
....
|
||||
./run --debug-vm-ex 'break qemu_add_opts;run'
|
||||
....
|
||||
|
||||
which is equivalent to the more verbose:
|
||||
|
||||
....
|
||||
./run --debug-vm-args '-ex "break qemu_add_opts" -ex "run"'
|
||||
....
|
||||
|
||||
if you ever want need anything besides -ex.
|
||||
|
||||
Or if things get really involved and you want a debug script:
|
||||
|
||||
....
|
||||
|
||||
12
run
12
run
@@ -56,6 +56,14 @@ pass the given arguments to GDB on the replay.
|
||||
help='''\
|
||||
Like --debug-vm, but also source this file. Equivalent to
|
||||
--debug-vm-args='-ex "source $file"'.
|
||||
'''
|
||||
)
|
||||
self.add_argument(
|
||||
'--debug-vm-ex',
|
||||
default='',
|
||||
help='''\
|
||||
Like --debug-vm-args, but takes as argument a semicolon separated list of
|
||||
-ex commands.
|
||||
'''
|
||||
)
|
||||
self.add_argument(
|
||||
@@ -377,8 +385,10 @@ Extra options to append at the end of the emulator command line.
|
||||
self.env['tmux'] = True
|
||||
if self.env['debug_vm_rr']:
|
||||
debug_vm = ['rr', 'record']
|
||||
elif self.env['debug_vm'] or self.env['debug_vm_args'] or self.env['debug_vm_file']:
|
||||
elif self.env['debug_vm'] or self.env['debug_vm_args'] or self.env['debug_vm_file'] or self.env['debug_vm_ex']:
|
||||
debug_vm = ['gdb', LF, '-q', LF] + self.sh.shlex_split(self.env['debug_vm_args'])
|
||||
for cmd in self.env['debug_vm_ex'].split(';'):
|
||||
debug_vm.extend(['-ex', cmd, LF]);
|
||||
if self.env['debug_vm_file'] is not None:
|
||||
debug_vm.extend(['-ex', 'source {}'.format(self.env['debug_vm_file']), LF])
|
||||
debug_vm.extend(['--args', LF])
|
||||
|
||||
Reference in New Issue
Block a user