m1n1.hv, run_guest.py: Make exception hook enable an argument

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-09-15 22:10:07 +09:00
parent 2f8beb02b4
commit 6627873267
2 changed files with 6 additions and 1 deletions

View file

@ -133,6 +133,7 @@ class HV(Reloadable):
self.xnu_mode = False self.xnu_mode = False
self._update_shell_locals() self._update_shell_locals()
self.wdt_cpu = None self.wdt_cpu = None
self.hook_exceptions = False
def _reloadme(self): def _reloadme(self):
super()._reloadme() super()._reloadme()
@ -579,7 +580,8 @@ class HV(Reloadable):
ctx.elr += 4 ctx.elr += 4
#self.patch_exception_handling() if self.hook_exceptions:
self.patch_exception_handling()
return True return True

View file

@ -10,6 +10,7 @@ parser.add_argument('-s', '--symbols', type=pathlib.Path)
parser.add_argument('-m', '--script', type=pathlib.Path, action='append', default=[]) parser.add_argument('-m', '--script', type=pathlib.Path, action='append', default=[])
parser.add_argument('-c', '--command', action="append", default=[]) parser.add_argument('-c', '--command', action="append", default=[])
parser.add_argument('-S', '--shell', action="store_true") parser.add_argument('-S', '--shell', action="store_true")
parser.add_argument('-e', '--hook-exceptions', action="store_true")
parser.add_argument('payload', type=pathlib.Path) parser.add_argument('payload', type=pathlib.Path)
parser.add_argument('boot_args', default=[], nargs="*") parser.add_argument('boot_args', default=[], nargs="*")
args = parser.parse_args() args = parser.parse_args()
@ -27,6 +28,8 @@ u = ProxyUtils(p, heap_size = 128 * 1024 * 1024)
hv = HV(iface, p, u) hv = HV(iface, p, u)
hv.hook_exceptions = args.hook_exceptions
hv.init() hv.init()
if len(args.boot_args) > 0: if len(args.boot_args) > 0: