aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Interpreter/CommandObject.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2023-03-24 10:38:56 -0700
committerJim Ingham <jingham@apple.com>2023-03-24 10:40:10 -0700
commit75ca15fcbb2e1b3671e41f971a000c6d59f5e5ae (patch)
treefa0b90c72543d14332478f29827341b1753927fd /lldb/source/Interpreter/CommandObject.cpp
parent6a423ee34447f29384fa6b8d7943809f2a8267d2 (diff)
downloadllvm-75ca15fcbb2e1b3671e41f971a000c6d59f5e5ae.zip
llvm-75ca15fcbb2e1b3671e41f971a000c6d59f5e5ae.tar.gz
llvm-75ca15fcbb2e1b3671e41f971a000c6d59f5e5ae.tar.bz2
Fix backtick handling in parsed commands.
https://reviews.llvm.org/D146779
Diffstat (limited to 'lldb/source/Interpreter/CommandObject.cpp')
-rw-r--r--lldb/source/Interpreter/CommandObject.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp
index 4500378..c13ce4e 100644
--- a/lldb/source/Interpreter/CommandObject.cpp
+++ b/lldb/source/Interpreter/CommandObject.cpp
@@ -727,10 +727,14 @@ bool CommandObjectParsed::Execute(const char *args_string,
}
if (!handled) {
for (auto entry : llvm::enumerate(cmd_args.entries())) {
- if (!entry.value().ref().empty() && entry.value().GetQuoteChar() == '`') {
- cmd_args.ReplaceArgumentAtIndex(
- entry.index(),
- m_interpreter.ProcessEmbeddedScriptCommands(entry.value().c_str()));
+ const Args::ArgEntry &value = entry.value();
+ if (!value.ref().empty() && value.GetQuoteChar() == '`') {
+ // We have to put the backtick back in place for PreprocessCommand.
+ std::string opt_string = value.c_str();
+ Status error;
+ error = m_interpreter.PreprocessToken(opt_string);
+ if (error.Success())
+ cmd_args.ReplaceArgumentAtIndex(entry.index(), opt_string);
}
}