[lldb] Make Process and subclass constructors protected
authorMichał Górny <mgorny@moritz.systems>
Fri, 5 Aug 2022 17:39:42 +0000 (19:39 +0200)
committerMichał Górny <mgorny@moritz.systems>
Mon, 8 Aug 2022 15:34:27 +0000 (17:34 +0200)
commit9b031d5e3a7b455308257a71116a603e76c8c679
tree8087466908ca913f45c4267b35c688c71e1e546c
parente64025045457b7f52201fbd48b24739f64074b59
[lldb] Make Process and subclass constructors protected

Make constructors of the Process and its subclasses class protected,
to prevent accidentally constructing Process on stack when it could be
afterwards accessed via a shared_ptr (since it uses
std::enable_shared_from_this<>).

The only place where a stack allocation was used were unittests,
and fixing them via declaring an explicit public constructor
in the respective mock classes is trivial.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D131275
lldb/include/lldb/Target/PostMortemProcess.h
lldb/include/lldb/Target/Process.h
lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
lldb/source/Plugins/Process/scripted/ScriptedProcess.h
lldb/unittests/Expression/DWARFExpressionTest.cpp
lldb/unittests/Process/ProcessEventDataTest.cpp
lldb/unittests/Target/ExecutionContextTest.cpp
lldb/unittests/Thread/ThreadTest.cpp