From: Tim Newsome Date: Sun, 13 Aug 2017 19:33:07 +0000 (-0700) Subject: Make MemTest* catch reading too many words. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=373630164e91cefbd104c132b9b400d10d9e193b;p=riscv-tests.git Make MemTest* catch reading too many words. For one of the test addresses, use the highest possible one to ensure that OpenOCD isn't secretly reading/writing more words than requested. --- diff --git a/debug/gdbserver.py b/debug/gdbserver.py index dea9990..ed881e4 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -124,13 +124,12 @@ class SimpleMemoryTest(GdbTest): assertEqual(self.gdb.p("sizeof(%s)" % data_type), size) a = 0x86753095555aaaa & ((1<<(size*8))-1) b = 0xdeadbeef12345678 & ((1<<(size*8))-1) - self.gdb.p("*((%s*)0x%x) = 0x%x" % (data_type, self.target.ram, a)) - self.gdb.p("*((%s*)0x%x) = 0x%x" % (data_type, self.target.ram + size, - b)) - assertEqual(self.gdb.p("*((%s*)0x%x)" % (data_type, self.target.ram)), - a) - assertEqual(self.gdb.p("*((%s*)0x%x)" % ( - data_type, self.target.ram + size)), b) + addrA = self.target.ram + addrB = self.target.ram + self.target.ram_size - size + self.gdb.p("*((%s*)0x%x) = 0x%x" % (data_type, addrA, a)) + self.gdb.p("*((%s*)0x%x) = 0x%x" % (data_type, addrB, b)) + assertEqual(self.gdb.p("*((%s*)0x%x)" % (data_type, addrA)), a) + assertEqual(self.gdb.p("*((%s*)0x%x)" % (data_type, addrB)), b) class MemTest8(SimpleMemoryTest): def test(self):