--debug-vm-args affects --debug-vm-rr, fix #112

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-01-07 00:00:01 +00:00
parent 2cfe56decf
commit d5876c9980
2 changed files with 20 additions and 4 deletions

11
run
View File

@@ -2,6 +2,7 @@
import os
import re
import shlex
import shutil
import subprocess
import sys
@@ -44,7 +45,10 @@ See also: https://cirosantilli.com/linux-kernel-module-cheat#debug-the-emulator
self.add_argument(
'--debug-vm-args',
default='',
help='Like --debug-vm, but also pass arguments to GDB'
help='''\
Pass arguments to GDB. Implies --debug-vm. If --debug-vm-rr is used,
pass the given arguments to GDB on the replay.
'''
)
self.add_argument(
'--debug-vm-file',
@@ -841,8 +845,11 @@ Extra options to append at the end of the emulator command line.
stdin_path=self.env['stdin_file'],
)
if self.env['debug_vm_rr']:
rr_cmd = ['rr', 'replay', LF, '-o', '-q', LF]
for arg in shlex.split(self.env['debug_vm_args']):
rr_cmd.extend(['-o', arg, LF]);
exit_status = self.sh.run_cmd(
['rr', 'replay', '-o', '-q'],
rr_cmd,
raise_on_failure=False,
show_stdout=show_stdout,
)