[all-commits] [llvm/llvm-project] 3e0ad1: [lldb/Commands] Add command options for ScriptedPr...

Med Ismail Bennani via All-commits all-commits at lists.llvm.org
Tue Mar 23 10:25:20 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3e0ad115439622b9c3e6ca9fd64c7fb07a679f1a
      https://github.com/llvm/llvm-project/commit/3e0ad115439622b9c3e6ca9fd64c7fb07a679f1a
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M lldb/bindings/interface/SBLaunchInfo.i
    M lldb/include/lldb/API/SBLaunchInfo.h
    M lldb/include/lldb/API/SBStream.h
    M lldb/include/lldb/API/SBStructuredData.h
    M lldb/include/lldb/Host/ProcessLaunchInfo.h
    M lldb/source/API/SBLaunchInfo.cpp
    M lldb/source/Commands/CommandObjectPlatform.cpp
    M lldb/source/Commands/CommandObjectProcess.cpp
    M lldb/source/Commands/CommandOptionsProcessLaunch.cpp
    M lldb/source/Commands/CommandOptionsProcessLaunch.h
    M lldb/source/Host/common/ProcessLaunchInfo.cpp
    M lldb/source/Target/Target.cpp

  Log Message:
  -----------
  [lldb/Commands] Add command options for ScriptedProcess to ProcessLaunch

This patch adds a new command options to the CommandObjectProcessLaunch
for scripted processes.

Among the options, the user need to specify the class name managing the
scripted process. The user can also use a key-value dictionary holding
arbitrary data that will be passed to the managing class.

This patch also adds getters and setters to `SBLaunchInfo` for the
class name managing the scripted process and the dictionary.

rdar://65508855

Differential Review: https://reviews.llvm.org/D95710

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


  Commit: 1f6a57c1a0fad922e04a2b1f414b092d4b0cd8b0
      https://github.com/llvm/llvm-project/commit/1f6a57c1a0fad922e04a2b1f414b092d4b0cd8b0
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M lldb/bindings/python/python-wrapper.swig
    M lldb/include/lldb/API/SBData.h
    M lldb/include/lldb/API/SBError.h
    M lldb/include/lldb/API/SBThreadPlan.h
    M lldb/include/lldb/Interpreter/ScriptInterpreter.h
    A lldb/include/lldb/Interpreter/ScriptedProcessInterface.h
    M lldb/include/lldb/lldb-forward.h
    M lldb/source/Interpreter/ScriptInterpreter.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
    A lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.cpp
    A lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
    A lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp
    A lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.h
    M lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp

  Log Message:
  -----------
  [lldb/Interpreter] Add ScriptInterpreter Wrapper for ScriptedProcess

This patch adds a ScriptedProcess interface to the ScriptInterpreter and
more specifically, to the ScriptInterpreterPython.

This interface will be used in the C++ `ScriptProcess` Process Plugin to
call the script methods.

At the moment, not all methods are implemented, they will upstreamed in
upcoming patches.

This patch also adds helper methods to the ScriptInterpreter to
convert `SBAPI` Types (SBData & SBError) to `lldb_private` types
(DataExtractor & Status).

rdar://65508855

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

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


  Commit: f3176f5fede202985ab51d215f4d0a58b6c91d83
      https://github.com/llvm/llvm-project/commit/f3176f5fede202985ab51d215f4d0a58b6c91d83
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M lldb/bindings/python/CMakeLists.txt
    A lldb/examples/python/scripted_process/my_scripted_process.py
    A lldb/examples/python/scripted_process/scripted_process.py
    A lldb/test/API/functionalities/scripted_process/Makefile
    A lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py
    A lldb/test/API/functionalities/scripted_process/main.c

  Log Message:
  -----------
  [lldb/bindings] Add Python ScriptedProcess base class to lldb module

In order to facilitate the writting of Scripted Processes, this patch
introduces a `ScriptedProcess` python base class in the lldb module.

The base class holds the python interface with all the - abstract -
methods that need to be implemented by the inherited class but also some
methods that can be overwritten.

This patch also provides an example of a Scripted Process with the
`MyScriptedProcess` class.

rdar://65508855

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

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


  Commit: dd391e1ef762d79f86112dc2480a89c9be066ce1
      https://github.com/llvm/llvm-project/commit/dd391e1ef762d79f86112dc2480a89c9be066ce1
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M lldb/bindings/python/CMakeLists.txt
    M lldb/include/lldb/Target/Process.h
    M lldb/source/Plugins/Process/CMakeLists.txt
    A lldb/source/Plugins/Process/scripted/CMakeLists.txt
    A lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
    A lldb/source/Plugins/Process/scripted/ScriptedProcess.h
    M lldb/source/Target/Target.cpp
    M lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py

  Log Message:
  -----------
  [lldb/Plugins] Add ScriptedProcess Process Plugin

This patch introduces Scripted Processes to lldb.

The goal, here, is to be able to attach in the debugger to fake processes
that are backed by script files (in Python, Lua, Swift, etc ...) and
inspect them statically.

Scripted Processes can be used in cooperative multithreading environments
like the XNU Kernel or other real-time operating systems, but it can
also help us improve the debugger testing infrastructure by writting
synthetic tests that simulates hard-to-reproduce process/thread states.

Although ScriptedProcess is not feature-complete at the moment, it has
basic execution capabilities and will improve in the following patches.

rdar://65508855

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

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


Compare: https://github.com/llvm/llvm-project/compare/f46c41febb88...dd391e1ef762


More information about the All-commits mailing list