- Modified code that enables writing new user-defined commands and use them through LLDB CLI. Modifications are:
- Define the 'syntax' for each user-defined command
- Added an argument in SBCommandInterpreter::AddCommand() and SBCommand::AddCommand() API
- Allow passing syntax for each user-defined command
- Earlier, only 'help' could be defined and passed for commands
- Passed 'number of arguments' entered on CLI for user-defined commands
- Added an argument (number of options) in SBCommandPluginInterface::DoExecute() API to know the number of arguments passed for commands
- In CommandPluginInterfaceImplementation class:
- Make the data member m_backend a shared_ptr
- Avoids memory leaks of dynamically allocated SBCommandPluginInterface instances created in lldb::PluginInitialize() API
- Define the 'syntax' for each user-defined command
Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>
You can't change public API, you can only add to it. Just add another function with syntax and leave the other one alone.