[lldb] "target create" shouldn't save target if the command failed
TargetList::CreateTarget automatically adds created target to the list, however, CommandObjectTargetCreate does some additional preparation after creating a target and which can fail. The command should remove created target if it failed. Since the function has many ways to return, scope guard does this work safely. Changes to the TargetList make target adding and selection more transparent. Other changes remove unnecessary SetSelectedTarget after CreateTarget. Differential Revision: https://reviews.llvm.org/D93052
Loading
Please sign in to comment