Handle aliasing a non-top-level command.
authorJim Ingham <jingham@apple.com>
Wed, 9 Nov 2022 18:11:16 +0000 (10:11 -0800)
committerJim Ingham <jingham@apple.com>
Wed, 9 Nov 2022 18:11:16 +0000 (10:11 -0800)
commitd518ed42ae85786c371fd4578f72ab7eb286cb30
tree0db9ca570b81acfb409aba93b42a3a9a7613532a
parentb565e7f0c4cb1768f6c43499aed95adb8cc4f04a
Handle aliasing a non-top-level command.

This didn't work previously because we had to check whether the incoming
command was an alias command, but if it wasn't we still used the result
of that lookup - which was by the command's node name.  That fails for
non-top-level commands.  In this case, the resolution is pretty simple since
we already have the node's CommandObject, so all we needed to do was turn
it into a shared pointer, for which I added enable_shared_from_this to the
CommandObject.

Differential Revision: https://reviews.llvm.org/D137662
lldb/include/lldb/Interpreter/CommandObject.h
lldb/source/Commands/CommandObjectCommands.cpp
lldb/test/API/commands/command/container/TestContainerCommands.py