summaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectThreadUtil.cpp
diff options
context:
space:
mode:
authorjimingham <jingham@apple.com>2024-02-27 10:34:01 -0800
committerGitHub <noreply@github.com>2024-02-27 10:34:01 -0800
commit2d704f4bf2edb0f9343dac818ab4d29442be9968 (patch)
treeef20273e98e399b40906c2b36e8172d3ef36e2e8 /lldb/source/Commands/CommandObjectThreadUtil.cpp
parentabc693fb4051dfb3a49ba2dcdbc2d164c53f2a51 (diff)
Start to clean up the process of defining command arguments. (#83097)
Partly, there's just a lot of unnecessary boiler plate. It's also possible to define combinations of arguments that make no sense (e.g. eArgRepeatPlus followed by eArgRepeatPlain...) but these are never checked since we just push_back directly into the argument definitions. This commit is step 1 of this cleanup - do the obvious stuff. In it, all the simple homogenous argument lists and the breakpoint/watchpoint ID/Range types, are set with common functions. This is an NFC change, it just centralizes boiler plate. There's no checking yet because you can't get a single argument wrong. The end goal is that all argument definition goes through functions and m_arguments is hidden so that you can't define inconsistent argument sets.
Diffstat (limited to 'lldb/source/Commands/CommandObjectThreadUtil.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectThreadUtil.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectThreadUtil.cpp b/lldb/source/Commands/CommandObjectThreadUtil.cpp
index d7fa4190a245..cdc5946547f4 100644
--- a/lldb/source/Commands/CommandObjectThreadUtil.cpp
+++ b/lldb/source/Commands/CommandObjectThreadUtil.cpp
@@ -21,8 +21,7 @@ CommandObjectIterateOverThreads::CommandObjectIterateOverThreads(
const char *syntax, uint32_t flags)
: CommandObjectParsed(interpreter, name, help, syntax, flags) {
// These commands all take thread ID's as arguments.
- CommandArgumentData thread_arg{eArgTypeThreadIndex, eArgRepeatStar};
- m_arguments.push_back({thread_arg});
+ AddSimpleArgumentList(eArgTypeThreadIndex, eArgRepeatStar);
}
CommandObjectMultipleThreads::CommandObjectMultipleThreads(
@@ -30,8 +29,7 @@ CommandObjectMultipleThreads::CommandObjectMultipleThreads(
const char *syntax, uint32_t flags)
: CommandObjectParsed(interpreter, name, help, syntax, flags) {
// These commands all take thread ID's as arguments.
- CommandArgumentData thread_arg{eArgTypeThreadIndex, eArgRepeatStar};
- m_arguments.push_back({thread_arg});
+ AddSimpleArgumentList(eArgTypeThreadIndex, eArgRepeatStar);
}
void CommandObjectIterateOverThreads::DoExecute(Args &command,