| 777 | } |
| 778 | |
| 779 | void MIDebugSession::addUserCommand(const QString& cmd) |
| 780 | { |
| 781 | auto adjustedCommand = cmd; |
| 782 | if (!cmd.isEmpty() && cmd[0].isDigit()) { |
| 783 | // Add a space to the beginning so debugger won't get confused if the |
| 784 | // command starts with a number (won't mix it up with command token added). |
| 785 | adjustedCommand.prepend(QLatin1Char{' '}); |
| 786 | } |
| 787 | queueCmd(std::make_unique<UserCommand>(MI::NonMI, adjustedCommand)); |
| 788 | |
| 789 | // User command can theoretically modify absolutely everything, |
| 790 | // so need to force a reload. |
| 791 | |
| 792 | // We can do it right now, and don't wait for user command to finish |
| 793 | // since commands used to reload all view will be executed after |
| 794 | // user command anyway. |
| 795 | if (!debuggerStateIsOn(s_appNotStarted) && !debuggerStateIsOn(s_programExited)) |
| 796 | raiseEvent(program_state_changed); |
| 797 | } |
| 798 | |
| 799 | std::unique_ptr<MICommand> MIDebugSession::createCommand(CommandType type, const QString& arguments, |
| 800 | CommandFlags flags) const |