--debug-vm-ex for the win

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-06-25 05:00:04 +00:00
parent c9d15228ab
commit 9f0f6dc054
2 changed files with 20 additions and 2 deletions

View File

@@ -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
View File

@@ -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])