From 4c8fab6e1c5594e0b2a655a9089622ddd7ca00d5 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Tue, 25 Jul 2023 13:41:42 -0700 Subject: [PATCH] debug: Better interlock when interacting with gdb CLI. Actually wait for the command to be echoed back. This means we won't be confused if there are extra newlines in gdb output. --- debug/testlib.py | 1 + 1 file changed, 1 insertion(+) diff --git a/debug/testlib.py b/debug/testlib.py index 435b41b5a..b665edb6f 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -795,6 +795,7 @@ def command(self, command, ops=1, reset_delays=0): timeout = max(1, ops) * self.timeout self.active_child.sendline(command) try: + self.active_child.expect(re.escape(command), timeout=timeout) self.active_child.expect("\n", timeout=timeout) except pexpect.exceptions.TIMEOUT as exc: raise CommandSendTimeout(command) from exc