aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2020-07-27 14:28:30 +0200
committerRaphael Isemann <teemperor@gmail.com>2020-07-27 14:36:47 +0200
commit432241955e032fba3d8b584ee6388212909bee9b (patch)
tree77a52724bdf08ce6d426576d87306c107fae4699 /lldb/source/Interpreter/CommandInterpreter.cpp
parent90684d1545167ee4e0c93d8eaf6ba4a3c7ab710e (diff)
downloadllvm-432241955e032fba3d8b584ee6388212909bee9b.zip
llvm-432241955e032fba3d8b584ee6388212909bee9b.tar.gz
llvm-432241955e032fba3d8b584ee6388212909bee9b.tar.bz2
[lldb][NFC] Use a StringRef for AddRegexCommand::AddRegexCommand parameters
Summary: This way we can get rid of this 1024 char buffer workaround. Reviewers: #lldb, labath Reviewed By: labath Subscribers: JDevlieghere Differential Revision: https://reviews.llvm.org/D84528
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index aca3654..4786e46 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -631,15 +631,10 @@ void CommandInterpreter::LoadCommandDictionary() {
if (tbreak_regex_cmd_up) {
bool success = true;
for (size_t i = 0; i < num_regexes; i++) {
- // If you add a resultant command string longer than 1024 characters be
- // sure to increase the size of this buffer.
- char buffer[1024];
- int num_printed =
- snprintf(buffer, 1024, "%s %s", break_regexes[i][1], "-o 1");
- lldbassert(num_printed < 1024);
- UNUSED_IF_ASSERT_DISABLED(num_printed);
+ std::string command = break_regexes[i][1];
+ command += " -o 1";
success =
- tbreak_regex_cmd_up->AddRegexCommand(break_regexes[i][0], buffer);
+ tbreak_regex_cmd_up->AddRegexCommand(break_regexes[i][0], command);
if (!success)
break;
}