[lldb/Target] Add ability to set a label to targets
authorMed Ismail Bennani <ismail@bennani.ma>
Fri, 2 Jun 2023 08:34:27 +0000 (01:34 -0700)
committerMed Ismail Bennani <ismail@bennani.ma>
Tue, 6 Jun 2023 17:58:34 +0000 (10:58 -0700)
commit1e82b20118e31bd6c3844a84e03f701997a9b7ed
tree2f500de367a4fd18b98f61d91b0c6038a075afa1
parentb95ed8b6d9354fa10094b6425ecc84dd33682a58
[lldb/Target] Add ability to set a label to targets

This patch add the ability for the user to set a label for a target.

This can be very useful when debugging targets with the same executables
in the same session.

Labels can be set either at the target creation in the command
interpreter or at any time using the SBAPI.

Target labels show up in the `target list` output, following the target
index, and they also allow the user to switch targets using them.

rdar://105016191

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

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
lldb/include/lldb/API/SBTarget.h
lldb/include/lldb/Target/Target.h
lldb/include/lldb/Target/TargetList.h
lldb/source/API/SBTarget.cpp
lldb/source/Commands/CommandObjectTarget.cpp
lldb/source/Target/Target.cpp
lldb/source/Target/TargetList.cpp
lldb/test/Shell/Target/target-label.test [new file with mode: 0644]