added verbosity control to user mode emulator
This commit is contained in:
parent
b396e0c5eb
commit
7904a4dae8
@ -17,6 +17,7 @@ if __name__ == '__main__':
|
||||
|
||||
all_ins_names = list(InstructionSetDict.keys())
|
||||
|
||||
|
||||
class OptionStringAction(argparse.Action):
|
||||
def __init__(self, option_strings, dest, keys=None, omit_empty=False, **kwargs):
|
||||
if keys is None:
|
||||
@ -65,6 +66,9 @@ if __name__ == '__main__':
|
||||
|
||||
parser.add_argument('--stack_size', type=int, help='Stack size of loaded programs, defaults to 8MB', nargs='?')
|
||||
|
||||
parser.add_argument('-v', '--verbose', help="Verbosity level (can be used multiple times)", action='count',
|
||||
default=0)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# create a RunConfig from the cli args
|
||||
@ -75,7 +79,8 @@ if __name__ == '__main__':
|
||||
debug_on_exception=not args.options['fail_on_ex'],
|
||||
add_accept_imm=args.options['add_accept_imm'],
|
||||
scall_fs=args.syscall_opts['fs_access'],
|
||||
scall_input=not args.syscall_opts['disable_input']
|
||||
scall_input=not args.syscall_opts['disable_input'],
|
||||
verbosity=args.verbose
|
||||
)
|
||||
for k, v in dict(cfg_dict).items():
|
||||
if v is None:
|
||||
@ -106,7 +111,7 @@ if __name__ == '__main__':
|
||||
cpu.setup_stack(cfg.stack_size)
|
||||
|
||||
# launch the last loaded program
|
||||
cpu.launch(cpu.mmu.programs[-1])
|
||||
cpu.launch(cpu.mmu.programs[-1], verbose=cfg.verbosity > 1)
|
||||
except RiscemuBaseException as e:
|
||||
print("Error: {}".format(e.message()))
|
||||
e.print_stacktrace()
|
||||
|
@ -4,16 +4,12 @@ RiscEmu (c) 2021 Anton Lydike
|
||||
SPDX-License-Identifier: MIT
|
||||
"""
|
||||
|
||||
import sys
|
||||
from dataclasses import dataclass
|
||||
from typing import Dict, IO
|
||||
import sys
|
||||
|
||||
from .helpers import *
|
||||
|
||||
import riscemu
|
||||
|
||||
import typing
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from riscemu.CPU import UserModeCPU
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user