From 8ccfcab34ffb068f127e88be9fb1f42bb46f3af4 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 3 Jan 2022 16:49:58 +0100 Subject: [lldb/platform-gdb] Clear cached protocol state upon disconnection Previously we would persist the flags indicating whether the remote side supports a particular feature across reconnects, which is obviously not a good idea. I implement the clearing by nuking (its the only way to be sure :) the entire GDBRemoteCommunication object in the disconnect operation and creating a new one upon connection. This allows us to maintain a nice invariant that the GDBRemoteCommunication object (which is now a pointer) exists only if it is connected. The downside to that is that a lot of functions now needs to check the validity of the pointer instead of blindly accessing the object. The process communication does not suffer from the same issue because we always destroy the entire Process object for a relaunch. Differential Revision: https://reviews.llvm.org/D116539 --- lldb/packages/Python/lldbsuite/test/lldbgdbclient.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/lldbgdbclient.py') diff --git a/lldb/packages/Python/lldbsuite/test/lldbgdbclient.py b/lldb/packages/Python/lldbsuite/test/lldbgdbclient.py index dd5b044..320ae0d 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbgdbclient.py +++ b/lldb/packages/Python/lldbsuite/test/lldbgdbclient.py @@ -58,7 +58,7 @@ class GDBRemoteTestBase(TestBase): self.assertTrue(process, PROCESS_IS_VALID) return process - def assertPacketLogContains(self, packets): + def assertPacketLogContains(self, packets, log=None): """ Assert that the mock server's packet log contains the given packets. @@ -69,9 +69,10 @@ class GDBRemoteTestBase(TestBase): The check does not require that the packets be consecutive, but does require that they are ordered in the log as they ordered in the arg. """ + if log is None: + log = self.server.responder.packetLog i = 0 j = 0 - log = self.server.responder.packetLog while i < len(packets) and j < len(log): if log[j] == packets[i]: -- cgit v1.1