diff options
author | Gongyu Deng <gy_deng@icloud.com> | 2020-06-30 13:14:46 +0200 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2020-06-30 13:50:14 +0200 |
commit | c37d25f0d1e059b39fbbc1ccc9f52ddba42be6b9 (patch) | |
tree | 14b3cb826eaed828c74a048119cda71dcc09e43f /lldb/source/Commands/CommandObjectFrame.cpp | |
parent | 33bae9c265486cd37e0612711a863f0a4b865a26 (diff) | |
download | llvm-c37d25f0d1e059b39fbbc1ccc9f52ddba42be6b9.zip llvm-c37d25f0d1e059b39fbbc1ccc9f52ddba42be6b9.tar.gz llvm-c37d25f0d1e059b39fbbc1ccc9f52ddba42be6b9.tar.bz2 |
[lldb] Tab completion for `frame recognizer delete`
Summary: Provided tab completion for command `frame recognizer delete`.
Reviewers: teemperor, JDevlieghere
Reviewed By: teemperor, JDevlieghere
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D81241
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectFrame.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 9ad4e32..5677b16 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -936,6 +936,33 @@ public: ~CommandObjectFrameRecognizerDelete() override = default; + void + HandleArgumentCompletion(CompletionRequest &request, + OptionElementVector &opt_element_vector) override { + if (request.GetCursorIndex() != 0) + return; + + StackFrameRecognizerManager::ForEach( + [&request](uint32_t rid, std::string rname, std::string module, + llvm::ArrayRef<lldb_private::ConstString> symbols, + bool regexp) { + StreamString strm; + if (rname.empty()) + rname = "(internal)"; + + strm << rname; + if (!module.empty()) + strm << ", module " << module; + if (!symbols.empty()) + for (auto &symbol : symbols) + strm << ", symbol " << symbol; + if (regexp) + strm << " (regexp)"; + + request.TryCompleteCurrentArg(std::to_string(rid), strm.GetString()); + }); + } + protected: bool DoExecute(Args &command, CommandReturnObject &result) override { if (command.GetArgumentCount() == 0) { |