diff options
author | Gongyu Deng <gy_deng@icloud.com> | 2020-05-11 15:54:13 +0200 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2020-05-11 15:55:11 +0200 |
commit | e87362e6894e052456c645129ac570f6bc23e8d1 (patch) | |
tree | 75ef14ed38ea463820360eb2dbbb4090de5b0a2c /lldb | |
parent | 25d6995079431531c2c7c8955ebe9a3d1875180d (diff) | |
download | llvm-e87362e6894e052456c645129ac570f6bc23e8d1.zip llvm-e87362e6894e052456c645129ac570f6bc23e8d1.tar.gz llvm-e87362e6894e052456c645129ac570f6bc23e8d1.tar.bz2 |
Tab completion for breakpoint write and breakpoint name add/delete
Summary: Apply the common completion created in [[ https://reviews.llvm.org/D75418 | Revision D75418 ]] to the commands `breakpoint write` and `breakpoint name add/delete`.
Reviewers: teemperor, JDevlieghere
Reviewed By: teemperor
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D79686
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 24 | ||||
-rw-r--r-- | lldb/test/API/functionalities/completion/TestCompletion.py | 6 |
2 files changed, 27 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 11cded6..fbd96c2 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -1770,6 +1770,14 @@ public: ~CommandObjectBreakpointNameAdd() override = default; + void + HandleArgumentCompletion(CompletionRequest &request, + OptionElementVector &opt_element_vector) override { + CommandCompletions::InvokeCommonCompletionCallbacks( + GetCommandInterpreter(), CommandCompletions::eBreakpointCompletion, + request, nullptr); + } + Options *GetOptions() override { return &m_option_group; } protected: @@ -1849,6 +1857,14 @@ public: ~CommandObjectBreakpointNameDelete() override = default; + void + HandleArgumentCompletion(CompletionRequest &request, + OptionElementVector &opt_element_vector) override { + CommandCompletions::InvokeCommonCompletionCallbacks( + GetCommandInterpreter(), CommandCompletions::eBreakpointCompletion, + request, nullptr); + } + Options *GetOptions() override { return &m_option_group; } protected: @@ -2147,6 +2163,14 @@ public: ~CommandObjectBreakpointWrite() override = default; + void + HandleArgumentCompletion(CompletionRequest &request, + OptionElementVector &opt_element_vector) override { + CommandCompletions::InvokeCommonCompletionCallbacks( + GetCommandInterpreter(), CommandCompletions::eBreakpointCompletion, + request, nullptr); + } + Options *GetOptions() override { return &m_options; } class CommandOptions : public Options { diff --git a/lldb/test/API/functionalities/completion/TestCompletion.py b/lldb/test/API/functionalities/completion/TestCompletion.py index 3a9c30a..a53ade5 100644 --- a/lldb/test/API/functionalities/completion/TestCompletion.py +++ b/lldb/test/API/functionalities/completion/TestCompletion.py @@ -478,10 +478,10 @@ class CommandLineCompletionTestCase(TestBase): self.complete_from_to('register write rbx ', []) - def test_breakpoint_enable_disable_delete_modify_with_ids(self): - """These four breakpoint subcommands should be completed with a list of breakpoint ids""" + def test_complete_breakpoint_with_ids(self): + """These breakpoint subcommands should be completed with a list of breakpoint ids""" - subcommands = ['enable', 'disable', 'delete', 'modify'] + subcommands = ['enable', 'disable', 'delete', 'modify', 'name add', 'name delete', 'write'] # The tab completion here is unavailable without a target for subcommand in subcommands: |