From e114167d0eb188d15c161f0a87ea2a01961a937c Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Thu, 14 Jul 2022 10:07:00 -0700 Subject: Only run SemihostingFileio on single hart systems. (#404) I don't have time to fix the bug right now, and nobody has run into the bug yet in any case. --- debug/gdbserver.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/debug/gdbserver.py b/debug/gdbserver.py index abda953..492ee83 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -975,6 +975,17 @@ class Semihosting(GdbSingleHartTest): assertIn("Do re mi fa so la ti do!", log) class SemihostingFileio(Semihosting): + def early_applicable(self): + # Semihosting file i/o doesn't work right when there are multiple harts + # in SMP mode, and the semihosting call comes from a hart other than the + # first one. + # The problem is that semihosting_common_fileio_info() is called only + # for the first target in an SMP list. Either the caller needs to be + # made aware of SMP targets, or that function needs to walk the list + # itself. (Or maybe we need to make a separate function just for RISC-V + # that does that.) + return len(self.target.harts) == 1 + def setup(self): self.gdb.command("monitor foreach t [target names] { " "targets $t; arm semihosting_fileio enable }") -- cgit v1.1