[all-commits] [llvm/llvm-project] 9b031d: [lldb] Make Process and subclass constructors prot...

Michał Górny via All-commits all-commits at lists.llvm.org
Mon Aug 8 08:34:43 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9b031d5e3a7b455308257a71116a603e76c8c679
      https://github.com/llvm/llvm-project/commit/9b031d5e3a7b455308257a71116a603e76c8c679
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-08-08 (Mon, 08 Aug 2022)

  Changed paths:
    M lldb/include/lldb/Target/PostMortemProcess.h
    M lldb/include/lldb/Target/Process.h
    M lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h
    M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
    M lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
    M lldb/source/Plugins/Process/scripted/ScriptedProcess.h
    M lldb/unittests/Expression/DWARFExpressionTest.cpp
    M lldb/unittests/Process/ProcessEventDataTest.cpp
    M lldb/unittests/Target/ExecutionContextTest.cpp
    M lldb/unittests/Thread/ThreadTest.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list