From 09491a888a215290be2f352a9a1455aa4d68e717 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sat, 3 Sep 2022 20:07:46 +0300 Subject: [PATCH] pysvp64dis: support verbose mode --- src/openpower/sv/trans/pysvp64dis.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/openpower/sv/trans/pysvp64dis.py b/src/openpower/sv/trans/pysvp64dis.py index 98848c66..ac653de9 100644 --- a/src/openpower/sv/trans/pysvp64dis.py +++ b/src/openpower/sv/trans/pysvp64dis.py @@ -49,10 +49,10 @@ def load(ifile, byteorder, **_): yield insn -def dump(insns, **_): +def dump(insns, verbose, **_): db = _Database(_find_wiki_dir()) for insn in insns: - yield from insn.disassemble(db=db) + yield from insn.disassemble(db=db, verbose=verbose) def main(): @@ -63,15 +63,13 @@ def main(): type=_argparse.FileType("w"), default=_sys.stdout) parser.add_argument("-b", "--byteorder", type=ByteOrder, default=ByteOrder.LITTLE) + parser.add_argument("-v", "--verbose", + action="store_true", default=False) args = dict(vars(parser.parse_args())) - ifile = args["ifile"] - ofile = args["ofile"] - byteorder = args["byteorder"] - - insns = load(ifile, byteorder) - for line in dump(insns): - print(line, file=ofile) + insns = load(**args) + for line in dump(insns, **args): + print(line, file=args["ofile"]) if __name__ == "__main__": -- 2.30.2