diff options
author | Megan Wachs <megan@sifive.com> | 2018-05-14 16:04:10 -0700 |
---|---|---|
committer | Megan Wachs <megan@sifive.com> | 2018-05-14 16:04:10 -0700 |
commit | bd8f01b7942177911208fff916492ad4539638fb (patch) | |
tree | 56c93a9f42a40671ed8373774c2e35f1770d8c9a /debug | |
parent | fc661cde26cfc3e07e74310ff73e1affaf047fd9 (diff) | |
parent | e0ce10a4148d4087e46252584b85b2fff3a0dbd7 (diff) | |
download | riscv-tests-bd8f01b7942177911208fff916492ad4539638fb.zip riscv-tests-bd8f01b7942177911208fff916492ad4539638fb.tar.gz riscv-tests-bd8f01b7942177911208fff916492ad4539638fb.tar.bz2 |
Merge remote-tracking branch 'origin/downloadtest' into debug-tests-more-single
Diffstat (limited to 'debug')
-rwxr-xr-x | debug/gdbserver.py | 21 | ||||
-rw-r--r-- | debug/testlib.py | 11 |
2 files changed, 11 insertions, 21 deletions
diff --git a/debug/gdbserver.py b/debug/gdbserver.py index 4472bdf..be89d19 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -830,25 +830,12 @@ class DownloadTest(GdbTest): self.binary = self.target.compile(self.hart, self.download_c.name, "programs/checksum.c") - self.gdb.command("file %s" % self.binary) + self.gdb.global_command("file %s" % self.binary) def test(self): - # 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.load() + self.parkOtherHarts() + self.gdb.command("b _exit") self.gdb.c() assertEqual(self.gdb.p("status"), self.crc) os.unlink(self.download_c.name) diff --git a/debug/testlib.py b/debug/testlib.py index 09baf1b..fb5bee3 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -861,10 +861,8 @@ class GdbTest(BaseTest): del self.gdb BaseTest.classTeardown(self) -class GdbSingleHartTest(GdbTest): - def classSetup(self): - GdbTest.classSetup(self) - + def parkOtherHarts(self): + """Park harts besides the currently selected one in loop_forever().""" for hart in self.target.harts: # Park all harts that we're not using in a safe place. if hart != self.hart: @@ -873,6 +871,11 @@ class GdbSingleHartTest(GdbTest): self.gdb.select_hart(self.hart) +class GdbSingleHartTest(GdbTest): + def classSetup(self): + GdbTest.classSetup(self) + self.parkOtherHarts() + class ExamineTarget(GdbTest): def test(self): for hart in self.target.harts: |