diff options
author | Megan Wachs <megan@sifive.com> | 2018-05-14 08:46:03 -0700 |
---|---|---|
committer | Megan Wachs <megan@sifive.com> | 2018-05-14 08:46:03 -0700 |
commit | 6513bdb6f8ed77cd6a333ebc166e964e15357065 (patch) | |
tree | 0d132548bad2068aebd5576119fc3a03eac33c30 /debug | |
parent | 6bf953c27e387df205ada4a30cb30fbb185e7754 (diff) | |
download | riscv-tests-6513bdb6f8ed77cd6a333ebc166e964e15357065.zip riscv-tests-6513bdb6f8ed77cd6a333ebc166e964e15357065.tar.gz riscv-tests-6513bdb6f8ed77cd6a333ebc166e964e15357065.tar.bz2 |
debug: Fixing the non-RTOS behavior for DownloadTest
Diffstat (limited to 'debug')
-rwxr-xr-x | debug/gdbserver.py | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/debug/gdbserver.py b/debug/gdbserver.py index adf179d..0c3cee4 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -835,13 +835,22 @@ class DownloadTest(GdbTest): self.gdb.command("file %s" % self.binary) def test(self): - self.gdb.load() - # Some hart will get there first! Let them race in RTOS mode. - for hart in self.target.harts: - self.gdb.select_hart(hart) - self.gdb.p("$pc=_start") - self.gdb.command("b _exit") - + # Some hart will compete the CRC calculation first! + # Let them race in RTOS mode. + # In non-RTOS mode, only one hart will continue. + # This loop will fail because the others won't know + # about '_start'. But if that is the case, they + # won't run on the `continue` either, so we don't really care. + try: + self.gdb.load() + for hart in self.target.harts: + self.gdb.select_hart(hart) + self.gdb.p("$pc=_start") + except ValueError: #invalid literal for int() with base 0: 'No symbol table is loaded. Use the "file" command.' + pass + finally: + + self.gdb.select_hart(self.hart) self.gdb.c() assertEqual(self.gdb.p("status"), self.crc) os.unlink(self.download_c.name) |