[lldb] Add scripted process launch/attach option to {,platform }process commands
authorMed Ismail Bennani <medismail.bennani@gmail.com>
Fri, 3 Mar 2023 23:27:07 +0000 (15:27 -0800)
committerMed Ismail Bennani <medismail.bennani@gmail.com>
Sat, 4 Mar 2023 03:33:02 +0000 (19:33 -0800)
commit3014a1c5a130daeb73f6d3b7280c5ceaeadc66a8
tree974442f6679db5d845094e5813bc982e1bff20e7
parent2d5348be2561402e284e26a9adf3a2e28e70c1f5
[lldb] Add scripted process launch/attach option to {,platform }process commands

This patch does several things:

First, it refactors the `CommandObject{,Platform}ProcessObject` command
option class into a separate `CommandOptionsProcessAttach` option group.

This will make sure both the `platform process attach` and `process attach`
command options will always stay in sync without having with duplicate
them each time. But more importantly, making this class an `OptionGroup`
allows us to combine with a `OptionGroupPythonClassWithDict` to add
support for the scripted process managing class name and user-provided
dictionary options.

This patch also improves feature parity between `ProcessLaunchInfo` and
`ProcessAttachInfo` with regard to ScriptedProcesses, by exposing the
various getters and setters necessary to use them through the SBAPI.

This is foundation work for adding support to "attach" to a process from
the scripted platform.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
lldb/include/lldb/API/SBAttachInfo.h
lldb/include/lldb/API/SBStructuredData.h
lldb/include/lldb/Target/Process.h
lldb/source/API/SBAttachInfo.cpp
lldb/source/Commands/CMakeLists.txt
lldb/source/Commands/CommandObjectPlatform.cpp
lldb/source/Commands/CommandObjectProcess.cpp
lldb/source/Commands/CommandOptionsProcessAttach.cpp [new file with mode: 0644]
lldb/source/Commands/CommandOptionsProcessAttach.h [new file with mode: 0644]