[all-commits] [llvm/llvm-project] af9210: [lldb] Remove the global platform list

Pavel Labath via All-commits all-commits at lists.llvm.org
Wed Apr 13 05:41:43 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: af921006d3792fa28d1070f015dcfd145e082ed2
      https://github.com/llvm/llvm-project/commit/af921006d3792fa28d1070f015dcfd145e082ed2
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2022-04-13 (Wed, 13 Apr 2022)

  Changed paths:
    M lldb/include/lldb/Target/Platform.h
    M lldb/packages/Python/lldbsuite/test/dotest.py
    M lldb/source/API/SBDebugger.cpp
    M lldb/source/API/SBPlatform.cpp
    M lldb/source/Interpreter/OptionGroupPlatform.cpp
    M lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
    M lldb/source/Plugins/Platform/POSIX/CMakeLists.txt
    M lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
    M lldb/source/Plugins/Platform/Windows/CMakeLists.txt
    M lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
    M lldb/source/Plugins/Platform/gdb-server/CMakeLists.txt
    M lldb/source/Target/Platform.cpp
    M lldb/source/Target/Process.cpp
    M lldb/source/Target/Target.cpp
    M lldb/source/Target/TargetList.cpp
    M lldb/test/API/python_api/debugger/TestDebuggerAPI.py
    A lldb/test/API/python_api/debugger/elf.yaml
    A lldb/test/API/python_api/debugger/macho.yaml
    M lldb/test/API/python_api/sbplatform/TestSBPlatform.py
    M lldb/unittests/Platform/PlatformTest.cpp

  Log Message:
  -----------
  [lldb] Remove the global platform list

This patch moves the platform creation and selection logic into the
per-debugger platform lists. I've tried to keep functional changes to a
minimum -- the main (only) observable difference in this change is that
APIs, which select a platform by name (e.g.,
Debugger::SetCurrentPlatform) will not automatically pick up a platform
associated with another debugger (or no debugger at all).

I've also added several tests for this functionality -- one of the
pleasant consequences of the debugger isolation is that it is now
possible to test the platform selection and creation logic.

This is a product of the discussion at
<https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594>.

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




More information about the All-commits mailing list