summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/semfix_watch.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/guest-diag/semfix_watch.py')
-rw-r--r--tools/guest-diag/semfix_watch.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/guest-diag/semfix_watch.py b/tools/guest-diag/semfix_watch.py
index 1fc6b01..1c33de6 100644
--- a/tools/guest-diag/semfix_watch.py
+++ b/tools/guest-diag/semfix_watch.py
@@ -96,16 +96,17 @@ class Qmp:
def hmp(self, line):
return self.cmd("human-monitor-command", **{"command-line": line}).get("return", "")
- def read64(self, addr, n=1):
+ def read64(self, addr, n=1, cache=True):
key = (addr, n)
- if key in self._cache:
+ if cache and key in self._cache:
return self._cache[key]
out = self.hmp("x/%dgx 0x%x" % (n, addr))
m = re.search(r":(.*)$", out, re.S)
if not m:
return []
vals = [int(x, 16) for x in re.findall(r"0x([0-9a-fA-F]+)", m.group(1))][:n]
- self._cache[key] = vals
+ if cache:
+ self._cache[key] = vals
return vals
def gva2gpa(self, va):