[Bug 18512] New: Support for defining multiword commands at the command line

Bug ID 18512
Summary Support for defining multiword commands at the command line
Product lldb
Version unspecified
Hardware All
OS All
Status NEW
Severity enhancement
Priority P
Component All Bugs
Assignee lldb-dev@cs.uiuc.edu
Reporter egranata@apple.com
Classification Unclassified

From a thread on lldb-dev:

we need general facilities for multiword commands definition by users.
Something like

(lldb) command multiword add info

And then you should be able to tell any command-defining command (e.g. command
script add, command alias, command regex) that whatever command it is crafting,
it is actually a subcommand, e.g.

(lldb) command alias —subcommand info — break breakpoint list

That would cause a hierarchy to be created where there is a multiword “info”
command at the root, with a break subcommand, whose implementation is
breakpoint list

> -info
> —— break ==> breakpoint list

With that, you could easily define your info command hierarchy in your
.lldbinit and anyone who wants to define their own multiword commands
hierarchies would naturally be allowed to do so.

Needless to say, one should protect system commands, such that you could not

(lldb) command alias —subcommand process doevilthings “some other command here"


(lldb) command multiword add process

or worse

(lldb) command multiword delete process