diff options
author | Tim Newsome <tim@sifive.com> | 2020-03-26 09:09:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-26 09:09:07 -0700 |
commit | 094985d1cfafe00548751285271bf8aab40f8d6d (patch) | |
tree | ddb5e3dd62ece964346ab88d84321643be1811d3 /debug/gdbserver.py | |
parent | 5fe6092f9917d80f4d1bfd02ce36275a87c89910 (diff) | |
download | riscv-tests-094985d1cfafe00548751285271bf8aab40f8d6d.zip riscv-tests-094985d1cfafe00548751285271bf8aab40f8d6d.tar.gz riscv-tests-094985d1cfafe00548751285271bf8aab40f8d6d.tar.bz2 |
Write a NOP program in PrivRw test. (#260)
Otherwise it only passes intermittently when I change _start, which is
very confusing.
Diffstat (limited to 'debug/gdbserver.py')
-rwxr-xr-x | debug/gdbserver.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/debug/gdbserver.py b/debug/gdbserver.py index db339a9..8800137 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -93,13 +93,7 @@ class SimpleRegisterTest(GdbTest): assertEqual(self.gdb.p("$%s" % alias), b) def setup(self): - # 0x13 is nop - self.gdb.command("p *((int*) 0x%x)=0x13" % self.hart.ram) - self.gdb.command("p *((int*) 0x%x)=0x13" % (self.hart.ram + 4)) - self.gdb.command("p *((int*) 0x%x)=0x13" % (self.hart.ram + 8)) - self.gdb.command("p *((int*) 0x%x)=0x13" % (self.hart.ram + 12)) - self.gdb.command("p *((int*) 0x%x)=0x13" % (self.hart.ram + 16)) - self.gdb.p("$pc=0x%x" % self.hart.ram) + self.write_nop_program(5) class SimpleS0Test(SimpleRegisterTest): def test(self): @@ -1256,8 +1250,7 @@ class PrivTest(GdbSingleHartTest): class PrivRw(PrivTest): def test(self): """Test reading/writing priv.""" - # Leave the PC at _start, where the first 4 instructions should be - # legal in any mode. + self.write_nop_program(4) for privilege in range(4): self.gdb.p("$priv=%d" % privilege) self.gdb.stepi() |