[Lldb-commits] [PATCH] D79686: Tab completion for breakpoint write and breakpoint name add/delete

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon May 11 06:57:01 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe87362e6894e: Tab completion for breakpoint write and breakpoint name add/delete (authored by MrHate, committed by teemperor).
Herald added a subscriber: lldb-commits.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79686/new/

https://reviews.llvm.org/D79686

Files:
  lldb/source/Commands/CommandObjectBreakpoint.cpp
  lldb/test/API/functionalities/completion/TestCompletion.py


Index: lldb/test/API/functionalities/completion/TestCompletion.py
===================================================================
--- lldb/test/API/functionalities/completion/TestCompletion.py
+++ lldb/test/API/functionalities/completion/TestCompletion.py
@@ -478,10 +478,10 @@
         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:
Index: lldb/source/Commands/CommandObjectBreakpoint.cpp
===================================================================
--- lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -1770,6 +1770,14 @@
 
   ~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 @@
 
   ~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 @@
 
   ~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 {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79686.263162.patch
Type: text/x-patch
Size: 2642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200511/eaf14859/attachment-0001.bin>


More information about the lldb-commits mailing list