util: Make m5 commands return a bool instead of calling usage.
authorGabe Black <gabeblack@google.com>
Tue, 7 Apr 2020 07:40:27 +0000 (00:40 -0700)
committerGabe Black <gabeblack@google.com>
Mon, 27 Jul 2020 08:28:42 +0000 (08:28 +0000)
commit8a4fcdee4dce240c4a2f8369f0aba8733234245b
treedb4bce05401573d7a5cc19b7d7fe5d4edbc98472
parentff82cba0343ad6b5cff753e5710dbfddbae20873
util: Make m5 commands return a bool instead of calling usage.

By delegating actually calling usage() elsewhere, we can remove a dependency
from the commands themselves, and also make testing easier since we won't
exit() every time we call a command with bad arguments.

Change-Id: I6b8e2cb77ce0456b16673f10349362cc53218bba
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27565
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
15 files changed:
util/m5/src/command.cc
util/m5/src/command.hh
util/m5/src/command.test.cc
util/m5/src/command/addsymbol.cc
util/m5/src/command/checkpoint.cc
util/m5/src/command/dumpresetstats.cc
util/m5/src/command/dumpstats.cc
util/m5/src/command/exit.cc
util/m5/src/command/fail.cc
util/m5/src/command/initparam.cc
util/m5/src/command/loadsymbol.cc
util/m5/src/command/readfile.cc
util/m5/src/command/resetstats.cc
util/m5/src/command/sum.cc
util/m5/src/command/writefile.cc