[Lldb-commits] [PATCH] D79659: [lldb/Commands] Add ability to run shell command on the host.

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri May 8 19:21:17 PDT 2020


jingham added a comment.

We certainly shouldn't duplicate the code for CommandObjectPlatformShell.

Why don't you just add a "m_use_host_platform" ivar to CommandObjectPlatformShell, and make two instances of CommandObjectPlatformShell, one with m_use_host_platform set to false and added as a sub-command of platform, and another instance with m_use_host_platform to true, and add that as a base command "shell"?  Then you'd just have to make CommandObjectPlatformShell switch on m_use_host_platform and either get the selected platform or the host platform.

You'd also have to adjust the help string for one or the other of the commands, but CommandObject::SetHelp and SetHelpLong will allow you to do that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79659





More information about the lldb-commits mailing list