self.gdb.command("b just_before_read_loop")
self.gdb.c()
read_loop = self.gdb.p("&read_loop")
+ read_again = self.gdb.p("&read_again")
self.gdb.command("rwatch data")
self.gdb.c()
# Accept hitting the breakpoint before or after the load instruction.
assertIn(self.gdb.p("$pc"), [read_loop, read_loop + 4])
assertEqual(self.gdb.p("$a0"), self.gdb.p("&data"))
+ self.gdb.c()
+ assertIn(self.gdb.p("$pc"), [read_again, read_again + 4])
+ assertEqual(self.gdb.p("$a0"), self.gdb.p("&data"))
+
# FIXME: Triggers aren't quite working yet
#class TriggerStoreAddress(TriggerTest):
# def test(self):
# define LREG lw
# define SREG sw
# define REGBYTES 4
-#endif
-
-#undef MCONTROL_TYPE
-#undef MCONTROL_DMODE
-#if __riscv_xlen == 64
-# define MCONTROL_TYPE (0xf<<(64-4))
-# define MCONTROL_DMODE (1<<(64-5))
-#else
-# define MCONTROL_TYPE (0xf<<(32-4))
-# define MCONTROL_DMODE (1<<(32-5))
#endif
.global main
li t2, 16
read_loop:
lw t1, 0(a0)
+ addi t1, t1, 1
addi t0, t0, 1
+read_again:
+ lw t1, 0(a0)
addi a0, a0, 4
blt t0, t2, read_loop