[Lldb-commits] [PATCH] D110298: Add "command multiword add" and the ability to add script commands into a user multiword hierarchy

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 22 17:31:00 PDT 2021


jingham created this revision.
jingham added reviewers: clayborg, JDevlieghere.
Herald added subscribers: dang, mgorny.
jingham requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

One of the ways that we organize all the functionality provided by lldb is to use a hierarchical command structure, with nested commands.  That means that when you first look at lldb, you see an organized set of commands mirroring the basic constructs in a debugger.  Then we use aliases to make the most commonly used commands available in a couple of keystrokes.  But when you start adding user commands, since they have to be root commands, you quickly overwhelm this orderly setup.  To fix this problem, I'm adding the ability for users who add commands to also nest them in a sensible hierarchy.

This change keeps the "built-in" and the "user added" command hierarchies separate, you can't add user commands or multiword subtrees into the builtin commands.  I think it would be too confusing if we started having user commands sprinkled among the built-in commands.  I also don't allow you to add aliases into multiword command trees.  The whole point of aliases is to make something available at the top level, so this didn't seem to make sense.

I apologize in advance for the size of the patch, but there really wasn't anything testable up till it was actually working, which is pretty much this patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110298

Files:
  lldb/include/lldb/Interpreter/CommandCompletions.h
  lldb/include/lldb/Interpreter/CommandInterpreter.h
  lldb/include/lldb/Interpreter/CommandObject.h
  lldb/include/lldb/Interpreter/CommandObjectMultiword.h
  lldb/source/API/SBCommandInterpreter.cpp
  lldb/source/Commands/CommandCompletions.cpp
  lldb/source/Commands/CommandObjectApropos.cpp
  lldb/source/Commands/CommandObjectCommands.cpp
  lldb/source/Commands/CommandObjectHelp.cpp
  lldb/source/Commands/CommandObjectMultiword.cpp
  lldb/source/Commands/Options.td
  lldb/source/Interpreter/CommandInterpreter.cpp
  lldb/source/Interpreter/CommandObject.cpp
  lldb/test/API/commands/command/invalid-args/TestInvalidArgsCommand.py
  lldb/test/API/commands/command/multiword/TestMultiwordCommands.py
  lldb/test/API/commands/command/multiword/welcome.py
  lldb/test/API/commands/command/script/TestCommandScript.py
  lldb/test/API/commands/expression/char/main.cpp
  lldb/test/API/functionalities/completion/TestCompletion.py
  lldb/unittests/Interpreter/CMakeLists.txt
  lldb/unittests/Interpreter/TestCommandPaths.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110298.374406.patch
Type: text/x-patch
Size: 78695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210923/cc8c3802/attachment-0001.bin>


More information about the lldb-commits mailing list