aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp43
1 files changed, 21 insertions, 22 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 23ebbdb..2b71f1b 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -487,18 +487,14 @@ public:
protected:
bool DoExecute(Args &args, CommandReturnObject &result) override {
- if (args.GetArgumentCount() == 0) {
- Stream &strm = result.GetOutputStream();
+ Stream &strm = result.GetOutputStream();
- bool show_stopped_process_status = false;
- if (DumpTargetList(GetDebugger().GetTargetList(),
- show_stopped_process_status, strm) == 0) {
- strm.PutCString("No targets.\n");
- }
- result.SetStatus(eReturnStatusSuccessFinishResult);
- } else {
- result.AppendError("the 'target list' command takes no arguments\n");
+ bool show_stopped_process_status = false;
+ if (DumpTargetList(GetDebugger().GetTargetList(),
+ show_stopped_process_status, strm) == 0) {
+ strm.PutCString("No targets.\n");
}
+ result.SetStatus(eReturnStatusSuccessFinishResult);
return result.Succeeded();
}
};
@@ -511,6 +507,8 @@ public:
: CommandObjectParsed(
interpreter, "target select",
"Select a target as the current target by target index.", nullptr) {
+ CommandArgumentData target_arg{eArgTypeTargetID, eArgRepeatPlain};
+ m_arguments.push_back({target_arg});
}
~CommandObjectTargetSelect() override = default;
@@ -575,6 +573,8 @@ public:
m_option_group.Append(&m_all_option, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
m_option_group.Append(&m_cleanup_option, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
m_option_group.Finalize();
+ CommandArgumentData target_arg{eArgTypeTargetID, eArgRepeatStar};
+ m_arguments.push_back({target_arg});
}
~CommandObjectTargetDelete() override = default;
@@ -1230,10 +1230,6 @@ public:
protected:
bool DoExecute(Args &command, CommandReturnObject &result) override {
Target *target = &GetSelectedTarget();
- if (command.GetArgumentCount() != 0) {
- result.AppendError("list takes no arguments\n");
- return result.Succeeded();
- }
target->GetImageSearchPathList().Dump(&result.GetOutputStream());
result.SetStatus(eReturnStatusSuccessFinishResult);
@@ -2454,6 +2450,8 @@ public:
LLDB_OPT_SET_1);
m_option_group.Append(&m_symbol_file, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
m_option_group.Finalize();
+ CommandArgumentData module_arg{eArgTypePath, eArgRepeatStar};
+ m_arguments.push_back({module_arg});
}
~CommandObjectTargetModulesAdd() override = default;
@@ -4019,6 +4017,8 @@ public:
m_option_group.Append(&m_current_stack_option, LLDB_OPT_SET_2,
LLDB_OPT_SET_2);
m_option_group.Finalize();
+ CommandArgumentData module_arg{eArgTypeShlibName, eArgRepeatPlain};
+ m_arguments.push_back({module_arg});
}
~CommandObjectTargetSymbolsAdd() override = default;
@@ -4867,7 +4867,10 @@ public:
CommandObjectTargetStopHookDelete(CommandInterpreter &interpreter)
: CommandObjectParsed(interpreter, "target stop-hook delete",
"Delete a stop-hook.",
- "target stop-hook delete [<idx>]") {}
+ "target stop-hook delete [<idx>]") {
+ CommandArgumentData hook_arg{eArgTypeStopHookID, eArgRepeatStar};
+ m_arguments.push_back({hook_arg});
+ }
~CommandObjectTargetStopHookDelete() override = default;
@@ -4921,6 +4924,8 @@ public:
bool enable, const char *name,
const char *help, const char *syntax)
: CommandObjectParsed(interpreter, name, help, syntax), m_enable(enable) {
+ CommandArgumentData hook_arg{eArgTypeStopHookID, eArgRepeatStar};
+ m_arguments.push_back({hook_arg});
}
~CommandObjectTargetStopHookEnableDisable() override = default;
@@ -4976,8 +4981,7 @@ class CommandObjectTargetStopHookList : public CommandObjectParsed {
public:
CommandObjectTargetStopHookList(CommandInterpreter &interpreter)
: CommandObjectParsed(interpreter, "target stop-hook list",
- "List all stop-hooks.",
- "target stop-hook list [<type>]") {}
+ "List all stop-hooks.", "target stop-hook list") {}
~CommandObjectTargetStopHookList() override = default;
@@ -5049,11 +5053,6 @@ public:
protected:
bool DoExecute(Args &command, CommandReturnObject &result) override {
- if (!command.empty()) {
- result.AppendError("target dump typesystem doesn't take arguments.");
- return result.Succeeded();
- }
-
// Go over every scratch TypeSystem and dump to the command output.
for (TypeSystem *ts : GetSelectedTarget().GetScratchTypeSystems())
ts->Dump(result.GetOutputStream().AsRawOstream());