diff options
| author | Jim Ingham <jingham@apple.com> | 2022-06-23 09:33:40 -0700 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2022-06-27 15:14:41 -0700 |
| commit | c1b07d617705dfdb3aabbdda51c1a40d99f7cc1a (patch) | |
| tree | ed7886491e1a97d19af06525fca43987a3dfb0a9 /lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp | |
| parent | 6824eee94203b16de7633050367505c2ad10c56a (diff) | |
Have CommandObjectParsed check for "commands that take no arguments".
This is currently being done in an ad hoc way, and so for some
commands it isn't being checked. We have the info to make this check,
since commands are supposed to add their arguments to the m_arguments
field of the CommandObject. This change uses that info to check whether
the command received arguments in error.
A handful of commands weren't defining their argument types, I also had
to fix them. And a bunch of commands were checking for arguments by
hand, so I removed those checks in favor of the CommandObject one. That
also meant I had to change some tests that were checking for the ad hoc
error outputs.
Differential Revision: https://reviews.llvm.org/D128453
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp')
| -rw-r--r-- | lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp index 2cf166bc8a1d..bc8e43764af6 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -4067,7 +4067,10 @@ public: "<reduction_kernel_type,...>]", eCommandRequiresProcess | eCommandProcessMustBeLaunched | eCommandProcessMustBePaused), - m_options(){}; + m_options() { + CommandArgumentData name_arg{eArgTypeName, eArgRepeatPlain}; + m_arguments.push_back({name_arg}); + }; class CommandOptions : public Options { public: @@ -4216,7 +4219,10 @@ public: "renderscript kernel breakpoint set <kernel_name> [-c x,y,z]", eCommandRequiresProcess | eCommandProcessMustBeLaunched | eCommandProcessMustBePaused), - m_options() {} + m_options() { + CommandArgumentData name_arg{eArgTypeName, eArgRepeatPlain}; + m_arguments.push_back({name_arg}); + } ~CommandObjectRenderScriptRuntimeKernelBreakpointSet() override = default; @@ -4311,7 +4317,10 @@ public: "but does not remove currently set breakpoints.", "renderscript kernel breakpoint all <enable/disable>", eCommandRequiresProcess | eCommandProcessMustBeLaunched | - eCommandProcessMustBePaused) {} + eCommandProcessMustBePaused) { + CommandArgumentData enable_arg{eArgTypeNone, eArgRepeatPlain}; + m_arguments.push_back({enable_arg}); + } ~CommandObjectRenderScriptRuntimeKernelBreakpointAll() override = default; @@ -4493,7 +4502,10 @@ public: "renderscript allocation dump <ID>", eCommandRequiresProcess | eCommandProcessMustBeLaunched), - m_options() {} + m_options() { + CommandArgumentData id_arg{eArgTypeUnsignedInteger, eArgRepeatPlain}; + m_arguments.push_back({id_arg}); + } ~CommandObjectRenderScriptRuntimeAllocationDump() override = default; @@ -4679,7 +4691,12 @@ public: interpreter, "renderscript allocation load", "Loads renderscript allocation contents from a file.", "renderscript allocation load <ID> <filename>", - eCommandRequiresProcess | eCommandProcessMustBeLaunched) {} + eCommandRequiresProcess | eCommandProcessMustBeLaunched) { + CommandArgumentData id_arg{eArgTypeUnsignedInteger, eArgRepeatPlain}; + CommandArgumentData name_arg{eArgTypeFilename, eArgRepeatPlain}; + m_arguments.push_back({id_arg}); + m_arguments.push_back({name_arg}); + } ~CommandObjectRenderScriptRuntimeAllocationLoad() override = default; @@ -4726,7 +4743,12 @@ public: "Write renderscript allocation contents to a file.", "renderscript allocation save <ID> <filename>", eCommandRequiresProcess | - eCommandProcessMustBeLaunched) {} + eCommandProcessMustBeLaunched) { + CommandArgumentData id_arg{eArgTypeUnsignedInteger, eArgRepeatPlain}; + CommandArgumentData name_arg{eArgTypeFilename, eArgRepeatPlain}; + m_arguments.push_back({id_arg}); + m_arguments.push_back({name_arg}); + } ~CommandObjectRenderScriptRuntimeAllocationSave() override = default; |
