[Lldb-commits] [PATCH] D116539: [lldb/platform-gdb] Clear cached protocol state upon disconnection

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 3 07:59:44 PST 2022


labath created this revision.
labath added reviewers: mgorny, JDevlieghere.
labath requested review of this revision.
Herald added a project: LLDB.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116539

Files:
  lldb/packages/Python/lldbsuite/test/lldbgdbclient.py
  lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
  lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
  lldb/test/API/functionalities/gdb_remote_client/TestGDBRemotePlatformFile.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116539.397067.patch
Type: text/x-patch
Size: 21175 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220103/f14dad98/attachment-0001.bin>


More information about the lldb-commits mailing list