This is an archive of the discontinued LLVM Phabricator instance.

[lldb/Commands] Add command options for ScriptedProcess to ProcessLaunch
AbandonedPublic

Authored by mib on Jan 29 2021, 5:04 PM.

Details

Reviewers
JDevlieghere
jasonmolenda
jingham
labath
Group Reviewers
Restricted Project
Summary

This patch adds a new command options to the CommandObjectProecessLaunch
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.

rdar://65508855

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

[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.

rdar://65508855

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

[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
ScriptedMachCoreProcess class.

rdar://65508855

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

[lldb/Plugins] Add ScriptedProcess Process Plugin

This patch introduces Scripted Processes to lldb.

The goal, here, is to be able to attach to fake processes in the debugger
that are backed my scripts (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

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

Diff Detail

Event Timeline

mib created this revision.Jan 29 2021, 5:04 PM
mib requested review of this revision.Jan 29 2021, 5:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 29 2021, 5:04 PM
mib abandoned this revision.Jan 29 2021, 5:08 PM

It seems arc grouped all commits into a single differential. I'll split them in separate diffs.