[Lldb-commits] [lldb] e87362e - Tab completion for breakpoint write and breakpoint name add/delete
Raphael Isemann via lldb-commits
lldb-commits at lists.llvm.org
Mon May 11 06:55:29 PDT 2020
Author: Gongyu Deng
Date: 2020-05-11T15:55:11+02:00
New Revision: e87362e6894e052456c645129ac570f6bc23e8d1
URL: https://github.com/llvm/llvm-project/commit/e87362e6894e052456c645129ac570f6bc23e8d1
DIFF: https://github.com/llvm/llvm-project/commit/e87362e6894e052456c645129ac570f6bc23e8d1.diff
LOG: 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
Added:
Modified:
lldb/source/Commands/CommandObjectBreakpoint.cpp
lldb/test/API/functionalities/completion/TestCompletion.py
Removed:
################################################################################
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 11cded687913..fbd96c2c5ef5 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -1770,6 +1770,14 @@ class CommandObjectBreakpointNameAdd : public CommandObjectParsed {
~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 @@ class CommandObjectBreakpointNameDelete : public CommandObjectParsed {
~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 @@ class CommandObjectBreakpointWrite : public CommandObjectParsed {
~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 3a9c30a3e62a..a53ade542f46 100644
--- a/lldb/test/API/functionalities/completion/TestCompletion.py
+++ b/lldb/test/API/functionalities/completion/TestCompletion.py
@@ -478,10 +478,10 @@ def test_register_read_and_write_on_x86(self):
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:
More information about the lldb-commits
mailing list