diff options
author | Tatyana Krasnukha <21970096+tkrasnukha@users.noreply.github.com> | 2020-12-11 11:09:39 +0300 |
---|---|---|
committer | Tatyana Krasnukha <tatyana@synopsys.com> | 2020-12-12 16:40:58 +0300 |
commit | 2634ec6ce9007f2406545ca28b4c72961f1e8f67 (patch) | |
tree | 1e274bba3a2afe5416300e0b2b5212d1075bb46f /lldb/source/Commands/CommandObjectProcess.cpp | |
parent | e52bc1d2bba794bfb004d35a395a2e3a8e69f9cb (diff) | |
download | llvm-2634ec6ce9007f2406545ca28b4c72961f1e8f67.zip llvm-2634ec6ce9007f2406545ca28b4c72961f1e8f67.tar.gz llvm-2634ec6ce9007f2406545ca28b4c72961f1e8f67.tar.bz2 |
[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
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 5ef0b87..1eef280 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -364,7 +364,6 @@ protected: result.AppendError(error.AsCString("Error creating target")); return false; } - GetDebugger().GetTargetList().SetSelectedTarget(target); } // Record the old executable module, we want to issue a warning if the |