[all-commits] [llvm/llvm-project] 103ad3: [lldb/Commands] Fix short option collision for `pr...

Med Ismail Bennani via All-commits all-commits at lists.llvm.org
Mon Mar 1 12:14:39 PST 2021


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

  Changed paths:
    M lldb/docs/use/map.rst
    M lldb/source/Commands/CommandOptionsProcessLaunch.cpp
    M lldb/source/Commands/Options.td

  Log Message:
  -----------
  [lldb/Commands] Fix short option collision for `process launch`

This patch changes the short option used in `CommandOptionsProcessLaunch`
for the `-v|--environment` command option to `-E|--environment`.

The reason for that is, that it collides with the `-v|--structured-data-value`
command option generated by `OptionGroupPythonClassWithDict` that
I'm using in an upcoming patch for the `process launch` command.

The long option `--environment` remains the same.

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

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


  Commit: d62a53aaf1d38a55d1affbd3a30d564a4e9d3171
      https://github.com/llvm/llvm-project/commit/d62a53aaf1d38a55d1affbd3a30d564a4e9d3171
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2021-03-01 (Mon, 01 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/API/SBTarget.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

  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: 182f0d1a34419445bb19d67581d6ac1afc98b7fa
      https://github.com/llvm/llvm-project/commit/182f0d1a34419445bb19d67581d6ac1afc98b7fa
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2021-03-01 (Mon, 01 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: 2cff3dec1171188ce04ab1a4373cc1885ab97be1
      https://github.com/llvm/llvm-project/commit/2cff3dec1171188ce04ab1a4373cc1885ab97be1
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2021-03-01 (Mon, 01 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: 46796762afe76496ec4dd900f64d0cf4cdc30e99
      https://github.com/llvm/llvm-project/commit/46796762afe76496ec4dd900f64d0cf4cdc30e99
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2021-03-01 (Mon, 01 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/ab45289d2e7c...46796762afe7


More information about the All-commits mailing list