From 56c2471e90d3d574765ea6aa5ca1c53a98f99acb Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Mon, 11 Jul 2022 16:18:37 +0100 Subject: Debug MemorySampleMixed: Disable 64-bit sampling on 32-bit targets (#402) --- debug/gdbserver.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/debug/gdbserver.py b/debug/gdbserver.py index 67dad0c..abda953 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -887,7 +887,10 @@ class MemorySampleSingle(MemorySampleTest): class MemorySampleMixed(MemorySampleTest): def test(self): addr = {} - for i, name in enumerate(("j", "i32", "i64")): + test_vars = ["j", "i32"] + if self.hart.xlen >= 64: + test_vars.append("i64") + for i, name in enumerate(test_vars): addr[name] = self.gdb.p(f"&{name}") sizeof = self.gdb.p(f"sizeof({name})") self.gdb.command(f"monitor riscv memory_sample {i} " @@ -897,7 +900,8 @@ class MemorySampleMixed(MemorySampleTest): self.check_incrementing_samples(raw_samples, addr["j"], tolerance=0x400000) self.check_samples_equal(raw_samples, addr["i32"], 0xdeadbeef) - self.check_samples_equal(raw_samples, addr["i64"], 0x1122334455667788) + if self.hart.xlen >= 64: + self.check_samples_equal(raw_samples, addr["i64"], 0x1122334455667788) class RepeatReadTest(DebugTest): def early_applicable(self): -- cgit v1.1