[all-commits] [llvm/llvm-project] d9f4d1: [lldb/Interpreter] Make ScriptedProcessInfo more g...

Med Ismail Bennani via All-commits all-commits at lists.llvm.org
Thu Jan 12 12:54:21 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d9f4d1b048520c50ca06e24b7886d77d3bb2fc29
      https://github.com/llvm/llvm-project/commit/d9f4d1b048520c50ca06e24b7886d77d3bb2fc29
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2023-01-12 (Thu, 12 Jan 2023)

  Changed paths:
    A lldb/include/lldb/Interpreter/ScriptedMetadata.h
    M lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
    M lldb/source/Plugins/Process/scripted/ScriptedProcess.h
    M lldb/source/Plugins/Process/scripted/ScriptedThread.cpp

  Log Message:
  -----------
  [lldb/Interpreter] Make ScriptedProcessInfo more generic

This patch moves the ScriptedProcessInfo class out of the
ScriptedProcess and hoist it as a standalone interpreter class, so it can be
reused with the Scripted Platform.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: 3fbc89048517e7152cce763db3b1e5738d558113
      https://github.com/llvm/llvm-project/commit/3fbc89048517e7152cce763db3b1e5738d558113
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2023-01-12 (Thu, 12 Jan 2023)

  Changed paths:
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h

  Log Message:
  -----------
  [lldb/Interpreter] Improve ScriptedPythonInterface::GetStatusFromMethod

This patch makes `ScriptedPythonInterface::GetStatusFromMethod` take a
parameter pack as an argument. That will allow it to pass arbitrary
arguments to the python method.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: 2d53527e9c64c70c24e1abba74fa0a8c8b3392b1
      https://github.com/llvm/llvm-project/commit/2d53527e9c64c70c24e1abba74fa0a8c8b3392b1
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2023-01-12 (Thu, 12 Jan 2023)

  Changed paths:
    M lldb/bindings/interface/SBPlatform.i
    M lldb/include/lldb/API/SBDebugger.h
    M lldb/include/lldb/API/SBPlatform.h
    M lldb/include/lldb/API/SBStructuredData.h
    M lldb/include/lldb/Interpreter/OptionGroupPlatform.h
    M lldb/include/lldb/Target/Platform.h
    M lldb/include/lldb/lldb-private-interfaces.h
    M lldb/source/API/SBDebugger.cpp
    M lldb/source/API/SBPlatform.cpp
    M lldb/source/Commands/CommandObjectPlatform.cpp
    M lldb/source/Commands/CommandObjectPlatform.h
    M lldb/source/Core/Debugger.cpp
    M lldb/source/Interpreter/OptionGroupPlatform.cpp
    M lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
    M lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
    M lldb/source/Plugins/Platform/Android/PlatformAndroid.h
    M lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
    M lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
    M lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
    M lldb/source/Plugins/Platform/Linux/PlatformLinux.h
    M lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
    M lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
    M lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
    M lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h
    M lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h
    M lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h
    M lldb/source/Plugins/Platform/MacOSX/PlatformRemoteMacOSX.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformRemoteMacOSX.h
    M lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h
    M lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
    M lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.h
    M lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp
    M lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.h
    M lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
    M lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.cpp
    M lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.h
    M lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
    M lldb/source/Plugins/Platform/Windows/PlatformWindows.h
    M lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
    M lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
    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/unittests/Core/DiagnosticEventTest.cpp
    M lldb/unittests/Expression/DWARFExpressionTest.cpp
    M lldb/unittests/Interpreter/TestCommandPaths.cpp
    M lldb/unittests/Platform/PlatformAppleSimulatorTest.cpp
    M lldb/unittests/Platform/PlatformSiginfoTest.cpp
    M lldb/unittests/Platform/PlatformTest.cpp
    M lldb/unittests/Process/ProcessEventDataTest.cpp
    M lldb/unittests/Target/ExecutionContextTest.cpp
    M lldb/unittests/Target/StackFrameRecognizerTest.cpp
    M lldb/unittests/Thread/ThreadTest.cpp

  Log Message:
  -----------
  [lldb] Add Debugger & ScriptedMetadata reference to Platform::CreateInstance

This patch is preparatory work for Scripted Platform support and does
multiple things:

First, it introduces new options for the `platform select` command and
`SBPlatform::Create` API, to hold a reference to the debugger object,
the name of the python script managing the Scripted Platform and a
structured data dictionary that the user can use to pass arbitrary data.

Then, it updates the various `Create` and `GetOrCreate` methods for
the `Platform` and `PlatformList` classes to pass down the new parameter
to the `Platform::CreateInstance` callbacks.

Finally, it updates every callback to reflect these changes.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: bb4ccc6688893d1bf38cfca76620d84f947b9de1
      https://github.com/llvm/llvm-project/commit/bb4ccc6688893d1bf38cfca76620d84f947b9de1
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2023-01-12 (Thu, 12 Jan 2023)

  Changed paths:
    M lldb/bindings/python/CMakeLists.txt
    M lldb/bindings/python/python-wrapper.swig
    M lldb/examples/python/scripted_process/crashlog_scripted_process.py
    A lldb/examples/python/scripted_process/scripted_platform.py
    M lldb/examples/python/scripted_process/scripted_process.py
    M lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp
    A lldb/test/API/functionalities/scripted_platform/my_scripted_platform.py
    M lldb/test/API/functionalities/scripted_process/dummy_scripted_process.py
    M lldb/test/API/functionalities/scripted_process/invalid_scripted_process.py
    M lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py
    M lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp

  Log Message:
  -----------
  [lldb] Add ScriptedPlatform python implementation

This patch introduces both the Scripted Platform python base
implementation and an example for it.

The base implementation is embedded in lldb python module under
`lldb.plugins.scripted_platform`.

This patch also refactor the various SWIG methods to create scripted
objects into a single method, that is now shared between the Scripted
Platform, Process and Thread. It also replaces the target argument by a
execution context object.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: b1256f2345f6c48b08cd8691778f39e3e9053f56
      https://github.com/llvm/llvm-project/commit/b1256f2345f6c48b08cd8691778f39e3e9053f56
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2023-01-12 (Thu, 12 Jan 2023)

  Changed paths:
    M lldb/include/lldb/Interpreter/ScriptInterpreter.h
    A lldb/include/lldb/Interpreter/ScriptedPlatformInterface.h
    M lldb/include/lldb/lldb-forward.h
    M lldb/source/Interpreter/ScriptInterpreter.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
    A lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPlatformPythonInterface.cpp
    A lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPlatformPythonInterface.h

  Log Message:
  -----------
  [lldb/Interpreter] Introduce ScriptedPlatform{,Python}Interface

This patch introduces both the ScriptedPlatformInterface and the
ScriptedPlatformPythonInterface. As the name suggests, these calls will
be used to call into the Scripted Platform python implementation from
the C++ Scripted Platform plugin instance.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


Compare: https://github.com/llvm/llvm-project/compare/c17e40ba52f3...b1256f2345f6


More information about the All-commits mailing list