Remove shared pointer from NativeProcessProtocol

Authored by labath on Jul 18 2017, 2:24 AM.


Remove shared pointer from NativeProcessProtocol

The usage of shared_from_this forces us to separate construction and
initialization phases, because shared_from_this() is not available in
the constructor (or destructor). The shared semantics are not necessary,
as we always have a clear owner of the native process class
(GDBRemoteCommunicationServerLLDB object). Even if we need shared
semantics in the future (which I think we should strongly avoid),
reverting this will not be necessary -- the owners can still easily
store the native process object in a shared pointer if they really want
to -- this just prevents the knowledge of that from leaking into the
class implementation.

After this a NativeThread object will hold a reference to the parent
process (instead of a weak_ptr) -- having a process instance always
available allows us to simplify some logic in this class (some of it was
already simplified because we were asserting that the process is
available, but this makes it obvious).

Reviewers: krytarowski, eugene, zturner

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D35123

llvm-svn: 308282


labathJul 18 2017, 2:24 AM
Differential Revision
D35123: Remove shared pointer from NativeProcessProtocol
rG095ec3da81de: [AMDGPU][MC] Added missing VOP3P opcodes