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

Pavel Labath via All-commits all-commits at lists.llvm.org
Wed Mar 9 07:17:27 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ffb9429b6f3c29ab4687b96fd85374924c98ad16
      https://github.com/llvm/llvm-project/commit/ffb9429b6f3c29ab4687b96fd85374924c98ad16
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2022-03-09 (Wed, 09 Mar 2022)

  Changed paths:
    M lldb/include/lldb/Target/Platform.h
    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

  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