aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectThread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands/CommandObjectThread.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp90
1 files changed, 8 insertions, 82 deletions
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index 52e493b..9cfff059 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -374,19 +374,7 @@ public:
eCommandProcessMustBePaused),
m_step_type(step_type), m_step_scope(step_scope),
m_class_options("scripted step") {
- CommandArgumentEntry arg;
- CommandArgumentData thread_id_arg;
-
- // Define the first (and only) variant of this arg.
- thread_id_arg.arg_type = eArgTypeThreadID;
- thread_id_arg.arg_repetition = eArgRepeatOptional;
-
- // There is only one variant this argument could be; put it into the
- // argument entry.
- arg.push_back(thread_id_arg);
-
- // Push the data for the first argument into the m_arguments vector.
- m_arguments.push_back(arg);
+ AddSimpleArgumentList(eArgTypeThreadID, eArgRepeatOptional);
if (step_type == eStepTypeScripted) {
m_all_options.Append(&m_class_options, LLDB_OPT_SET_1 | LLDB_OPT_SET_2,
@@ -643,19 +631,7 @@ public:
nullptr,
eCommandRequiresThread | eCommandTryTargetAPILock |
eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {
- CommandArgumentEntry arg;
- CommandArgumentData thread_idx_arg;
-
- // Define the first (and only) variant of this arg.
- thread_idx_arg.arg_type = eArgTypeThreadIndex;
- thread_idx_arg.arg_repetition = eArgRepeatPlus;
-
- // There is only one variant this argument could be; put it into the
- // argument entry.
- arg.push_back(thread_idx_arg);
-
- // Push the data for the first argument into the m_arguments vector.
- m_arguments.push_back(arg);
+ AddSimpleArgumentList(eArgTypeThreadIndex, eArgRepeatPlus);
}
~CommandObjectThreadContinue() override = default;
@@ -886,19 +862,7 @@ public:
nullptr,
eCommandRequiresThread | eCommandTryTargetAPILock |
eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {
- CommandArgumentEntry arg;
- CommandArgumentData line_num_arg;
-
- // Define the first (and only) variant of this arg.
- line_num_arg.arg_type = eArgTypeLineNum;
- line_num_arg.arg_repetition = eArgRepeatPlain;
-
- // There is only one variant this argument could be; put it into the
- // argument entry.
- arg.push_back(line_num_arg);
-
- // Push the data for the first argument into the m_arguments vector.
- m_arguments.push_back(arg);
+ AddSimpleArgumentList(eArgTypeLineNum);
}
~CommandObjectThreadUntil() override = default;
@@ -1539,19 +1503,7 @@ public:
eCommandRequiresFrame | eCommandTryTargetAPILock |
eCommandProcessMustBeLaunched |
eCommandProcessMustBePaused) {
- CommandArgumentEntry arg;
- CommandArgumentData expression_arg;
-
- // Define the first (and only) variant of this arg.
- expression_arg.arg_type = eArgTypeExpression;
- expression_arg.arg_repetition = eArgRepeatOptional;
-
- // There is only one variant this argument could be; put it into the
- // argument entry.
- arg.push_back(expression_arg);
-
- // Push the data for the first argument into the m_arguments vector.
- m_arguments.push_back(arg);
+ AddSimpleArgumentList(eArgTypeExpression, eArgRepeatOptional);
}
~CommandObjectThreadReturn() override = default;
@@ -1919,19 +1871,7 @@ public:
eCommandTryTargetAPILock |
eCommandProcessMustBeLaunched |
eCommandProcessMustBePaused) {
- CommandArgumentEntry arg;
- CommandArgumentData plan_index_arg;
-
- // Define the first (and only) variant of this arg.
- plan_index_arg.arg_type = eArgTypeUnsignedInteger;
- plan_index_arg.arg_repetition = eArgRepeatPlain;
-
- // There is only one variant this argument could be; put it into the
- // argument entry.
- arg.push_back(plan_index_arg);
-
- // Push the data for the first argument into the m_arguments vector.
- m_arguments.push_back(arg);
+ AddSimpleArgumentList(eArgTypeUnsignedInteger);
}
~CommandObjectThreadPlanDiscard() override = default;
@@ -1992,19 +1932,7 @@ public:
eCommandTryTargetAPILock |
eCommandProcessMustBeLaunched |
eCommandProcessMustBePaused) {
- CommandArgumentEntry arg;
- CommandArgumentData tid_arg;
-
- // Define the first (and only) variant of this arg.
- tid_arg.arg_type = eArgTypeThreadID;
- tid_arg.arg_repetition = eArgRepeatStar;
-
- // There is only one variant this argument could be; put it into the
- // argument entry.
- arg.push_back(tid_arg);
-
- // Push the data for the first argument into the m_arguments vector.
- m_arguments.push_back(arg);
+ AddSimpleArgumentList(eArgTypeThreadID, eArgRepeatStar);
}
~CommandObjectThreadPlanPrune() override = default;
@@ -2221,8 +2149,7 @@ public:
eCommandRequiresProcess | eCommandRequiresThread |
eCommandTryTargetAPILock | eCommandProcessMustBeLaunched |
eCommandProcessMustBePaused | eCommandProcessMustBeTraced) {
- CommandArgumentData thread_arg{eArgTypeThreadIndex, eArgRepeatOptional};
- m_arguments.push_back({thread_arg});
+ AddSimpleArgumentList(eArgTypeThreadIndex, eArgRepeatOptional);
}
~CommandObjectTraceDumpFunctionCalls() override = default;
@@ -2395,8 +2322,7 @@ public:
eCommandRequiresProcess | eCommandRequiresThread |
eCommandTryTargetAPILock | eCommandProcessMustBeLaunched |
eCommandProcessMustBePaused | eCommandProcessMustBeTraced) {
- CommandArgumentData thread_arg{eArgTypeThreadIndex, eArgRepeatOptional};
- m_arguments.push_back({thread_arg});
+ AddSimpleArgumentList(eArgTypeThreadIndex, eArgRepeatOptional);
}
~CommandObjectTraceDumpInstructions() override = default;