aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectProcess.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2020-07-27 14:05:23 +0200
committerRaphael Isemann <teemperor@gmail.com>2020-07-27 14:27:54 +0200
commitdb203e0268479d16d36a318c726cce5a4a5f75a6 (patch)
tree73f5f308d72428ffc31eac5635276d4081966607 /lldb/source/Commands/CommandObjectProcess.cpp
parent1ebcf03551c3136b8153d44968204c022f121ae6 (diff)
downloadllvm-db203e0268479d16d36a318c726cce5a4a5f75a6.zip
llvm-db203e0268479d16d36a318c726cce5a4a5f75a6.tar.gz
llvm-db203e0268479d16d36a318c726cce5a4a5f75a6.tar.bz2
[lldb] Modernize away some snprintf calls
Reviewers: #lldb, JDevlieghere Reviewed By: #lldb, JDevlieghere Subscribers: JDevlieghere Differential Revision: https://reviews.llvm.org/D84530
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index f86779d8..fd8d38e 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -48,19 +48,19 @@ protected:
state = process->GetState();
if (process->IsAlive() && state != eStateConnected) {
- char message[1024];
+ std::string message;
if (process->GetState() == eStateAttaching)
- ::snprintf(message, sizeof(message),
- "There is a pending attach, abort it and %s?",
- m_new_process_action.c_str());
+ message =
+ llvm::formatv("There is a pending attach, abort it and {0}?",
+ m_new_process_action);
else if (process->GetShouldDetach())
- ::snprintf(message, sizeof(message),
- "There is a running process, detach from it and %s?",
- m_new_process_action.c_str());
+ message = llvm::formatv(
+ "There is a running process, detach from it and {0}?",
+ m_new_process_action);
else
- ::snprintf(message, sizeof(message),
- "There is a running process, kill it and %s?",
- m_new_process_action.c_str());
+ message =
+ llvm::formatv("There is a running process, kill it and {0}?",
+ m_new_process_action);
if (!m_interpreter.Confirm(message, true)) {
result.SetStatus(eReturnStatusFailed);