From 84389156a342f95ccb53e488b590c5de1566381e Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 21 May 2021 14:57:11 +0100 Subject: [PATCH] return register values from GPR.dump in ISACaller --- src/openpower/decoder/isa/caller.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/openpower/decoder/isa/caller.py b/src/openpower/decoder/isa/caller.py index 05bb3fb6..5eef119c 100644 --- a/src/openpower/decoder/isa/caller.py +++ b/src/openpower/decoder/isa/caller.py @@ -124,13 +124,18 @@ class GPR(dict): print("GPR getitem", attr, rnum, "srcoffs", offs) return self.regfile[rnum] - def dump(self): - for i in range(0, len(self), 8): - s = [] - for j in range(8): - s.append("%08x" % self[i+j].value) - s = ' '.join(s) - print("reg", "%2d" % i, s) + def dump(self, printout=True): + res = [] + for i in range(len(self)): + res.append(self[i].value) + if printout: + for i in range(0, len(res), 8): + s = [] + for j in range(8): + s.append("%08x" % res[i+j]) + s = ' '.join(s) + print("reg", "%2d" % i, s) + return res class SPR(dict): -- 2.30.2