Lines Matching +full:second +full:- +full:sourcing
1 //===-- CommandInterpreter.cpp --------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
103 "To silence this warning without sourcing in the local .lldbinit,\n"
105 " settings set target.load-cwd-lldbinit false\n"
112 const char *CommandInterpreter::g_no_argument = "<no-argument>";
113 const char *CommandInterpreter::g_need_argument = "<need-argument>";
142 SetEventName(eBroadcastBitThreadShouldExit, "thread-should-exit");
143 SetEventName(eBroadcastBitResetPrompt, "reset-prompt");
147 m_collection_sp->Initialize(g_interpreter_properties);
292 // An alias arguments vector to reuse - reset it before use...
302 cmd_obj_sp = GetCommandSPExact("_regexp-attach");
304 AddAlias("attach", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
317 cmd_obj_sp = GetCommandSPExact("_regexp-break");
319 AddAlias("b", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
321 cmd_obj_sp = GetCommandSPExact("_regexp-tbreak");
323 AddAlias("tbreak", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
325 cmd_obj_sp = GetCommandSPExact("thread step-inst");
331 cmd_obj_sp = GetCommandSPExact("thread step-inst-over");
337 cmd_obj_sp = GetCommandSPExact("thread step-in");
342 "sif", cmd_obj_sp, "--end-linenumber block --step-in-target %1");
344 sif_alias->SetHelp("Step through the current block, stopping if you step "
347 sif_alias->SetSyntax("sif <TargetFunctionName>");
351 cmd_obj_sp = GetCommandSPExact("thread step-over");
357 cmd_obj_sp = GetCommandSPExact("thread step-out");
372 cmd_obj_sp = GetCommandSPExact("_regexp-jump");
374 AddAlias("j", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
375 AddAlias("jump", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
378 cmd_obj_sp = GetCommandSPExact("_regexp-list");
380 AddAlias("l", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
381 AddAlias("list", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
384 cmd_obj_sp = GetCommandSPExact("_regexp-env");
386 AddAlias("env", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
392 cmd_obj_sp = GetCommandSPExact("_regexp-up");
394 AddAlias("up", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
396 cmd_obj_sp = GetCommandSPExact("_regexp-down");
398 AddAlias("down", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
400 cmd_obj_sp = GetCommandSPExact("_regexp-display");
402 AddAlias("display", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
412 cmd_obj_sp = GetCommandSPExact("_regexp-undisplay");
414 AddAlias("undisplay", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
416 cmd_obj_sp = GetCommandSPExact("_regexp-bt");
418 AddAlias("bt", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
430 cmd_obj_sp = GetCommandSPExact("dwim-print");
432 AddAlias("p", cmd_obj_sp, "--")->SetHelpLong("");
433 AddAlias("print", cmd_obj_sp, "--")->SetHelpLong("");
434 if (auto *po = AddAlias("po", cmd_obj_sp, "-O --")) {
435 po->SetHelp("Evaluate an expression on the current thread. Displays any "
438 po->SetHelpLong("");
444 AddAlias("call", cmd_obj_sp, "--")->SetHelpLong("");
446 AddAlias("parray", cmd_obj_sp, "--element-count %1 --");
448 parray_alias->SetHelp
449 ("parray <COUNT> <EXPRESSION> -- lldb will evaluate EXPRESSION "
450 "to get a typed-pointer-to-an-array in memory, and will display "
452 parray_alias->SetHelpLong("");
455 "--object-description --element-count %1 --");
457 poarray_alias->SetHelp("poarray <COUNT> <EXPRESSION> -- lldb will "
460 poarray_alias->SetHelpLong("");
466 CommandAlias *shell_alias = AddAlias("shell", cmd_obj_sp, " --host --");
468 shell_alias->SetHelp("Run a shell command on the host.");
469 shell_alias->SetHelpLong("");
470 shell_alias->SetSyntax("shell <shell-command>");
484 AddAlias("r", cmd_obj_sp, "--");
485 AddAlias("run", cmd_obj_sp, "--");
487 AddAlias("r", cmd_obj_sp, "--shell-expand-args true --");
488 AddAlias("run", cmd_obj_sp, "--shell-expand-args true --");
492 defaultshell.Printf("--shell=%s --",
501 AddAlias("add-dsym", cmd_obj_sp);
506 AddAlias("rbreak", cmd_obj_sp, "--func-regex %1");
513 AddAlias("vo", cmd_obj_sp, "--object-description");
569 REGISTER_COMMAND_OBJECT("dwim-print", CommandObjectDWIMPrint);
594 // clang-format off
597 "breakpoint set --file '%1' --line %2 --column %3"},
599 "breakpoint set --file '%1' --line %2"},
600 {"^/([^/]+)/$", "breakpoint set --source-pattern-regexp '%1'"},
601 {"^([[:digit:]]+)[[:space:]]*$", "breakpoint set --line %1"},
602 {"^\\*?(0x[[:xdigit:]]+)[[:space:]]*$", "breakpoint set --address %1"},
603 {"^[\"']?([-+]?\\[.*\\])[\"']?[[:space:]]*$",
604 "breakpoint set --name '%1'"},
605 {"^(-.*)$", "breakpoint set %1"},
607 "breakpoint set --name '%2' --shlib '%1'"},
609 "breakpoint set --name '%1' --skip-prologue=0"},
611 "breakpoint set --name '%1'"}};
612 // clang-format on
618 *this, "_regexp-break",
621 "_regexp-break <filename>:<linenum>:<colnum>\n"
624 "_regexp-break <filename>:<linenum>\n"
627 "_regexp-break <linenum>\n"
630 "_regexp-break 0x<address>\n"
633 "_regexp-break <name>\n"
636 "_regexp-break &<name>\n"
639 "_regexp-break <module>`<name>\n"
642 "_regexp-break /<source-regex>/\n"
652 success = break_regex_cmd_up->AddRegexCommand(break_regexes[i][0],
658 break_regex_cmd_up->AddRegexCommand("^$", "breakpoint list --full");
662 m_command_dict[std::string(break_regex_cmd_sp->GetCommandName())] =
669 *this, "_regexp-tbreak",
670 "Set a one-shot breakpoint using one of several shorthand formats.",
672 "_regexp-break <filename>:<linenum>:<colnum>\n"
675 "_regexp-break <filename>:<linenum>\n"
678 "_regexp-break <linenum>\n"
681 "_regexp-break 0x<address>\n"
684 "_regexp-break <name>\n"
687 "_regexp-break &<name>\n"
690 "_regexp-break <module>`<name>\n"
693 "_regexp-break /<source-regex>/\n"
704 command += " -o 1";
706 tbreak_regex_cmd_up->AddRegexCommand(break_regexes[i][0], command);
711 tbreak_regex_cmd_up->AddRegexCommand("^$", "breakpoint list --full");
715 m_command_dict[std::string(tbreak_regex_cmd_sp->GetCommandName())] =
722 *this, "_regexp-attach", "Attach to process by ID or name.",
723 "_regexp-attach <pid> | <process-name>", 0, false));
725 if (attach_regex_cmd_up->AddRegexCommand("^([0-9]+)[[:space:]]*$",
726 "process attach --pid %1") &&
727 attach_regex_cmd_up->AddRegexCommand(
728 "^(-.*|.* -.*)$", "process attach %1") && // Any options that are
731 attach_regex_cmd_up->AddRegexCommand("^(.+)$",
732 "process attach --name '%1'") &&
733 attach_regex_cmd_up->AddRegexCommand("^$", "process attach")) {
735 m_command_dict[std::string(attach_regex_cmd_sp->GetCommandName())] =
741 new CommandObjectRegexCommand(*this, "_regexp-down",
745 "_regexp-down [<count>]", 0, false));
747 if (down_regex_cmd_up->AddRegexCommand("^$", "frame select -r -1") &&
748 down_regex_cmd_up->AddRegexCommand("^([0-9]+)$",
749 "frame select -r -%1")) {
751 m_command_dict[std::string(down_regex_cmd_sp->GetCommandName())] =
758 *this, "_regexp-up",
761 "_regexp-up [<count>]", 0, false));
763 if (up_regex_cmd_up->AddRegexCommand("^$", "frame select -r 1") &&
764 up_regex_cmd_up->AddRegexCommand("^([0-9]+)$", "frame select -r %1")) {
766 m_command_dict[std::string(up_regex_cmd_sp->GetCommandName())] =
773 *this, "_regexp-display",
774 "Evaluate an expression at every stop (see 'help target stop-hook'.)",
775 "_regexp-display expression", 0, false));
777 if (display_regex_cmd_up->AddRegexCommand(
778 "^(.+)$", "target stop-hook add -o \"expr -- %1\"")) {
780 m_command_dict[std::string(display_regex_cmd_sp->GetCommandName())] =
786 new CommandObjectRegexCommand(*this, "_regexp-undisplay",
788 "stop (specified by stop-hook index.)",
789 "_regexp-undisplay stop-hook-number", 0,
792 if (undisplay_regex_cmd_up->AddRegexCommand("^([0-9]+)$",
793 "target stop-hook delete %1")) {
795 m_command_dict[std::string(undisplay_regex_cmd_sp->GetCommandName())] =
802 *this, "gdb-remote",
805 "gdb-remote is an abbreviation for 'process connect --plugin "
806 "gdb-remote connect://<hostname>:<port>'\n",
807 "gdb-remote [<hostname>:]<portnum>", 0, false));
809 if (connect_gdb_remote_cmd_up->AddRegexCommand(
810 "^([^:]+|\\[[0-9a-fA-F:]+.*\\]):([0-9]+)$",
811 "process connect --plugin gdb-remote connect://%1:%2") &&
812 connect_gdb_remote_cmd_up->AddRegexCommand(
814 "process connect --plugin gdb-remote connect://localhost:%1")) {
816 m_command_dict[std::string(command_sp->GetCommandName())] = command_sp;
822 *this, "kdp-remote",
825 "kdp-remote is an abbreviation for 'process connect --plugin "
826 "kdp-remote udp://<hostname>:<port>'\n",
827 "kdp-remote <hostname>[:<portnum>]", 0, false));
829 if (connect_kdp_remote_cmd_up->AddRegexCommand(
831 "process connect --plugin kdp-remote udp://%1") &&
832 connect_kdp_remote_cmd_up->AddRegexCommand(
833 "^(.+)$", "process connect --plugin kdp-remote udp://%1:41139")) {
835 m_command_dict[std::string(command_sp->GetCommandName())] = command_sp;
841 *this, "_regexp-bt",
844 "displays all threads. Use 'settings set frame-format' to customize "
845 "the printing of individual frames and 'settings set thread-format' "
849 // accept but don't document "bt -c <number>" -- before bt was a regex
850 // command if you wanted to backtrace three frames you would do "bt -c 3"
853 if (bt_regex_cmd_up->AddRegexCommand("^([[:digit:]]+)[[:space:]]*$",
854 "thread backtrace -c %1") &&
855 bt_regex_cmd_up->AddRegexCommand("^-c ([[:digit:]]+)[[:space:]]*$",
856 "thread backtrace -c %1") &&
857 bt_regex_cmd_up->AddRegexCommand("^all[[:space:]]*$", "thread backtrace all") &&
858 bt_regex_cmd_up->AddRegexCommand("^[[:space:]]*$", "thread backtrace")) {
860 m_command_dict[std::string(command_sp->GetCommandName())] = command_sp;
866 *this, "_regexp-list",
869 "_regexp-list <file>:<line> // List around specific file/line\n"
870 "_regexp-list <line> // List current file around specified "
872 "_regexp-list <function-name> // List specified function\n"
873 "_regexp-list 0x<address> // List around specified address\n"
874 "_regexp-list -[<count>] // List previous <count> lines\n"
875 "_regexp-list // List subsequent lines",
878 if (list_regex_cmd_up->AddRegexCommand("^([0-9]+)[[:space:]]*$",
879 "source list --line %1") &&
880 list_regex_cmd_up->AddRegexCommand(
883 "source list --file '%1' --line %2") &&
884 list_regex_cmd_up->AddRegexCommand(
886 "source list --address %1") &&
887 list_regex_cmd_up->AddRegexCommand("^-[[:space:]]*$",
888 "source list --reverse") &&
889 list_regex_cmd_up->AddRegexCommand(
890 "^-([[:digit:]]+)[[:space:]]*$",
891 "source list --reverse --count %1") &&
892 list_regex_cmd_up->AddRegexCommand("^(.+)$",
893 "source list --name \"%1\"") &&
894 list_regex_cmd_up->AddRegexCommand("^$", "source list")) {
896 m_command_dict[std::string(list_regex_cmd_sp->GetCommandName())] =
903 *this, "_regexp-env",
906 "_regexp-env // Show environment\n"
907 "_regexp-env <name>=<value> // Set an environment variable",
910 if (env_regex_cmd_up->AddRegexCommand("^$",
911 "settings show target.env-vars") &&
912 env_regex_cmd_up->AddRegexCommand("^([A-Za-z_][A-Za-z_0-9]*=.*)$",
913 "settings set target.env-vars %1")) {
915 m_command_dict[std::string(env_regex_cmd_sp->GetCommandName())] =
922 *this, "_regexp-jump", "Set the program counter to a new address.",
924 "_regexp-jump <line>\n"
925 "_regexp-jump +<line-offset> | -<line-offset>\n"
926 "_regexp-jump <file>:<line>\n"
927 "_regexp-jump *<addr>\n",
930 if (jump_regex_cmd_up->AddRegexCommand("^\\*(.*)$",
931 "thread jump --addr %1") &&
932 jump_regex_cmd_up->AddRegexCommand("^([0-9]+)$",
933 "thread jump --line %1") &&
934 jump_regex_cmd_up->AddRegexCommand("^([^:]+):([0-9]+)$",
935 "thread jump --file %1 --line %2") &&
936 jump_regex_cmd_up->AddRegexCommand("^([+\\-][0-9]+)$",
937 "thread jump --by %1")) {
939 m_command_dict[std::string(jump_regex_cmd_sp->GetCommandName())] =
965 const char *name) -> CommandObjectMultiword * {
970 if (!cmd_sp->IsUserCommand()) {
976 CommandObjectMultiword *cmd_as_multi = cmd_sp->GetAsMultiwordCommand();
1006 size_t num_path_elements = num_args - (leaf_is_command ? 1 : 0);
1010 cur_cmd_sp = cur_as_multi->GetSubcommandSPExact(cur_name);
1027 command_sp = pos->second;
1033 command_sp = alias_pos->second;
1039 command_sp = pos->second;
1045 command_sp = pos->second;
1073 cmd.assign(matches->GetStringAtIndex(0));
1076 real_match_sp = pos->second;
1085 cmd.assign(matches->GetStringAtIndex(num_cmd_matches));
1088 alias_match_sp = alias_pos->second;
1098 matches->GetStringAtIndex(num_cmd_matches + num_alias_matches));
1102 user_match_sp = pos->second;
1111 cmd.assign(matches->GetStringAtIndex(num_cmd_matches + num_alias_matches +
1116 user_mw_match_sp = pos->second;
1135 matches->AppendString(cmd_str);
1137 descriptions->AppendString(command_sp->GetHelp());
1147 lldbassert((this == &cmd_sp->GetCommandInterpreter()) &&
1153 cmd_sp->SetIsUserCommand(false);
1158 if (!can_replace || !name_iter->second->IsRemovable())
1160 name_iter->second = cmd_sp;
1172 lldbassert((this == &cmd_sp->GetCommandInterpreter()) &&
1188 "by --overwrite or 'settings set interpreter.require-overwrite "
1193 if (cmd_sp->IsMultiwordObject()) {
1194 if (!m_user_mw_dict[std::string(name)]->IsRemovable()) {
1196 "can't replace explicitly non-removable multi-word command");
1200 if (!m_user_dict[std::string(name)]->IsRemovable()) {
1201 result.SetErrorString("can't replace explicitly non-removable command");
1207 cmd_sp->SetIsUserCommand(true);
1209 if (cmd_sp->IsMultiwordObject())
1219 // Break up the command string into words, in case it's a multi-word command.
1228 // We have a multi-word command (seemingly), so we need to do more work.
1237 // sub-command SP for each command word....
1240 if (!cmd_obj_sp->IsMultiwordObject()) {
1246 cmd_obj_sp = cmd_obj_sp->GetSubcommandSP(cmd_words.GetArgumentAtIndex(i));
1248 // The sub-command name was invalid. Fail and return.
1276 CommandObject *exact_cmd = found_elem->second.get();
1279 matches->AppendString(exact_cmd->GetCommandName());
1281 descriptions->AppendString(exact_cmd->GetHelp());
1356 lldbassert((this == &command_obj_sp->GetCommandInterpreter()) &&
1362 if (command_alias_up && command_alias_up->IsValid()) {
1383 if (force || pos->second->IsRemovable()) {
1430 (pos->first.compare(0, 1, "_") == 0))
1433 OutputFormattedHelpText(result.GetOutputStream(), pos->first, "--",
1434 pos->second->GetHelp(), max_len);
1450 OutputFormattedHelpText(result.GetOutputStream(), alias_pos->first, "--",
1451 alias_pos->second->GetHelp(), max_len);
1458 result.AppendMessage("Current user-defined commands:");
1462 OutputFormattedHelpText(result.GetOutputStream(), pos->first, "--",
1463 pos->second->GetHelp(), max_len);
1470 result.AppendMessage("Current user-defined container commands:");
1474 OutputFormattedHelpText(result.GetOutputStream(), pos->first, "--",
1475 pos->second->GetHelp(), max_len);
1481 "For more information on any command, type '%shelp <command-name>'.\n",
1487 // This function finds the final, lowest-level, alias-resolved command object
1502 std::string(command_string.substr(start, end - start));
1508 else if (cmd_obj->IsMultiwordObject()) {
1509 // Our current object is a multi-word object; see if the cmd_word is a
1510 // valid sub-command for our object.
1512 cmd_obj->GetSubcommandObject(cmd_word.c_str());
1515 else // cmd_word was not a valid sub-command word, so we are done
1518 // We have a cmd_obj and it is not a multi-word object, so we are done.
1522 // a multi-word object, or we are at the end of the command_string, then
1525 if (!cmd_obj || !cmd_obj->IsMultiwordObject() ||
1540 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_";
1556 size_t pos = s.find("--", offset);
1560 if (llvm::isSpace(s[pos - 1])) {
1561 // Check if the string ends "\s--" (where \s is a space character) or
1562 // if we have "\s--\s".
1591 command.assign(command_string, 1, end_quote_pos - 1);
1614 // actual commands can't start with '-' or '_'
1615 if (command[0] != '-' && command[0] != '_') {
1635 if (!alias_cmd_obj || !alias_cmd_obj->IsAlias()) {
1640 ((CommandAlias *)alias_cmd_obj)->Desugar();
1641 OptionArgVectorSP option_arg_vector_sp = desugared.second;
1648 result_str.Printf("%s", alias_cmd_obj->GetCommandName().str().c_str());
1696 if (strpos - start_fudge + arg_text.size() + len_fudge >
1702 strpos - start_fudge,
1731 if (start_backtick > 0 && command[start_backtick - 1] == '\\') {
1734 command.erase(start_backtick - 1, 1);
1755 end_backtick - expr_content_start);
1761 command.erase(start_backtick, end_backtick - start_backtick + 1);
1797 expr_result_valobj_sp->GetQualifiedRepresentationIfAvailable(
1798 expr_result_valobj_sp->GetDynamicValueType(), true);
1799 if (expr_result_valobj_sp->ResolveValue(scalar)) {
1827 error = expr_result_valobj_sp->GetError();
1879 transcript_item->AddStringItem("command", command_line);
1880 transcript_item->AddIntegerItem(
1896 // Check for empty line or comment line (lines whose first non-space
1950 // look-up and replacement, resulting in:
1964 if (cmd_obj && cmd_obj->WantsRawCommandString()) {
1975 // "br s -n main", command_string is now "breakpoint set -n main".
1977 llvm::StringRef command_name = cmd_obj ? cmd_obj->GetCommandName() : "<not found>";
1982 (cmd_obj != nullptr) ? cmd_obj->WantsRawCommandString() : false;
2006 cmd_obj->GetRepeatCommand(command_args, 0);
2008 LLDB_LOGF(log, "Repeat command: %s", repeat_command->data());
2019 const std::size_t actual_cmd_name_len = cmd_obj->GetCommandName().size();
2034 // fail when the command is "settings set interpreter.save-transcript true".
2036 transcript_item->AddStringItem("commandName", cmd_obj->GetCommandName());
2037 transcript_item->AddStringItem("commandArguments", remainder);
2041 cmd_obj->Execute(remainder.c_str(), result);
2049 // fail when the command is "settings set interpreter.save-transcript true".
2054 transcript_item->AddStringItem("output", result.GetOutputData());
2055 transcript_item->AddStringItem("error", result.GetErrorData());
2056 transcript_item->AddFloatItem("durationInSeconds",
2083 if (new_matches.GetSize() && cmd_obj && cmd_obj->IsMultiwordObject() &&
2105 command_object->HandleCompletion(request);
2135 for (int i = s - 1; i >= 0; --i) {
2149 m_command_io_handler_sp->SetPrompt(new_prompt);
2161 return confirm->GetResponse();
2170 return (CommandAlias *)pos->second.get();
2193 GetAlias(alias_name)->GetOptionArguments();
2195 bool wants_raw_input = alias_cmd_obj->WantsRawCommandString();
2202 Args new_args(alias_cmd_obj->GetCommandName());
2209 // Make *sure* it has a " -- " in the right place in the
2211 size_t pos = raw_input_string.find(" -- ");
2214 raw_input_string.insert(0, " -- ");
2230 if (!wants_raw_input || (value != "--")) {
2332 init_file_name.append("-");
2353 (llvm::Twine(".lldbinit-") +
2355 llvm::Twine("-repl"))
2427 /// whose name is "~/.lldbinit" followed by a "-" and the name of the program.
2483 platform_sp = target->GetPlatform();
2497 ProcessSP process_sp(target_sp->GetProcessSP());
2501 if (eStateStopped != process_sp->GetState())
2504 for (const auto &thread_sp : process_sp->GetThreadList().Threads()) {
2505 StopInfoSP stop_info = thread_sp->GetStopInfo();
2513 const StopReason reason = stop_info->GetStopReason();
2520 const auto stop_signal = static_cast<int32_t>(stop_info->GetValue());
2521 UnixSignalsSP signals_sp = process_sp->GetUnixSignals();
2522 if (!signals_sp || !signals_sp->SignalIsValid(stop_signal))
2526 const auto sigint_num = signals_sp->GetSignalNumberFromName("SIGINT");
2527 const auto sigstop_num = signals_sp->GetSignalNumberFromName("SIGSTOP");
2585 m_command_source_depth--;
2611 result.GetImmediateOutputStream()->Flush();
2614 result.GetImmediateErrorStream()->Flush();
2627 if (idx != num_lines - 1)
2647 if (idx != num_lines - 1)
2693 "Error reading commands from file %s - file not found.\n",
2737 // stop-on-crash can only be set, if it is present in all levels of
2812 false, // Not multi-line
2828 m_command_source_depth--;
2845 size_t line_width_max = max_columns - prefix.size();
2890 prefix_stream.Printf(" %-*s %*s ", (int)max_word_len, word_text.data(),
2904 text_strm.Printf("%-*s ", (int)max_word_len, word_text.data());
2923 chars_left = max_columns - indent_size;
2930 --chars_left;
2944 CommandObject *cmd_obj = pair.second.get();
2951 cmd_obj->HelpTextContainsWord(search_word, search_short_help,
2955 commands_help.AppendString(cmd_obj->GetHelp());
2958 if (auto *multiword_cmd = cmd_obj->GetAsMultiwordCommand()) {
2961 multiword_cmd->GetSubcommandDictionary());
3031 if (--m_iohandler_nesting_level == 0) {
3066 stream->Write(line.data(), line.size());
3067 stream->Write("\n", 1);
3074 stream->Printf("\n... Interrupted.\n");
3075 stream->Flush();
3105 // sourcing a commands file. We don't want blank lines to repeat the
3113 // When using a non-interactive file handle (like when sourcing commands
3118 io_handler.GetOutputStreamFileSP()->Printf(
3205 StateType state = process->GetState();
3207 process->Halt();
3215 if (script_interpreter->Interrupt())
3223 if (output_file == std::nullopt || output_file->empty()) {
3227 std::replace(now.begin(), now.end(), ':', '-');
3262 Status error = file->Write(m_transcript_stream.GetData(), byte_size);
3270 output_file->c_str());
3274 error = file->GetFileSpec(const_cast<FileSpec &>(file_spec));
3286 return (GetIOHandler() ? GetIOHandler()->GetIsInteractive() : false);
3309 io_handler_sp->SetUserData(baton);
3319 "lldb-python", // Name of input reader for history
3328 io_handler_sp->SetUserData(baton);
3340 // Always re-create the IOHandlerEditline in case the input changed. The old
3341 // instance might have had a non-interactive input and now it does or vice
3344 // Always re-create the IOHandlerEditline in case the input changed. The
3345 // old instance might have had a non-interactive input and now it does or
3350 if (options->m_stop_on_continue == eLazyBoolYes)
3352 if (options->m_stop_on_error == eLazyBoolYes)
3354 if (options->m_stop_on_crash == eLazyBoolYes)
3356 if (options->m_echo_commands != eLazyBoolNo)
3358 if (options->m_echo_comment_commands != eLazyBoolNo)
3360 if (options->m_print_results != eLazyBoolNo)
3362 if (options->m_print_errors != eLazyBoolNo)
3364 if (options->m_allow_repeats == eLazyBoolYes)
3386 // Always re-create the command interpreter when we run it in case any file
3433 (!is_alias) || (cmd_obj != nullptr && !cmd_obj->IsAlias());
3441 wants_raw_input = cmd_obj->WantsRawCommandString();
3445 llvm::StringRef cmd_name = cmd_obj->GetCommandName();
3447 wants_raw_input = cmd_obj->WantsRawCommandString();
3453 if (cmd_obj->IsMultiwordObject()) {
3455 cmd_obj->GetSubcommandObject(next_word.c_str());
3459 llvm::StringRef sub_cmd_name = sub_cmd_obj->GetCommandName();
3463 wants_raw_input = cmd_obj->WantsRawCommandString();
3506 if (cmd_obj->IsMultiwordObject()) {
3511 cmd_obj->GetCommandName().str().c_str(),
3513 next_word.empty() ? " -- " : " ", suffix.c_str());
3524 Options *command_options = cmd_obj->GetOptions();
3526 command_options->SupportsLongOption("gdb-format")) {
3527 std::string gdb_format_option("--gdb-format=");
3533 // Insert the gdb format option before the "--" that terminates
3544 revised_command_line.PutCString(" --");
3547 "the '%s' command doesn't support the --gdb-format option\n",
3548 cmd_obj->GetCommandName().str().c_str());