summaryrefslogtreecommitdiff
path: root/cmds/lshal/DebugCommand.cpp
diff options
context:
space:
mode:
author Yifan Hong <elsk@google.com> 2017-09-15 02:04:53 +0000
committer android-build-merger <android-build-merger@google.com> 2017-09-15 02:04:53 +0000
commit163a64a339e90320bf6134035ffb7d1f12565fcc (patch)
tree4d82904f43d9fec45d819380476dbd6b65884c22 /cmds/lshal/DebugCommand.cpp
parent655da335700eda383b2f99c8a90c72a4dc1e0a9d (diff)
parent880df0f7440e7a5897907d85e433abc8381e23ce (diff)
Merge changes from topic "lshal_released" am: 757fd44b93
am: 880df0f744 Change-Id: Iff081ead4bb8dc83c2ba982627edacd22dc007dd
Diffstat (limited to 'cmds/lshal/DebugCommand.cpp')
-rw-r--r--cmds/lshal/DebugCommand.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/cmds/lshal/DebugCommand.cpp b/cmds/lshal/DebugCommand.cpp
index 672cad67cb..622f866617 100644
--- a/cmds/lshal/DebugCommand.cpp
+++ b/cmds/lshal/DebugCommand.cpp
@@ -21,12 +21,16 @@
namespace android {
namespace lshal {
-DebugCommand::DebugCommand(Lshal &lshal) : mLshal(lshal) {
+std::string DebugCommand::getName() const {
+ return "debug";
}
-Status DebugCommand::parseArgs(const std::string &command, const Arg &arg) {
+std::string DebugCommand::getSimpleDescription() const {
+ return "Debug a specified HAL.";
+}
+
+Status DebugCommand::parseArgs(const Arg &arg) {
if (optind >= arg.argc) {
- mLshal.usage(command);
return USAGE;
}
mInterfaceName = arg.argv[optind];
@@ -37,8 +41,8 @@ Status DebugCommand::parseArgs(const std::string &command, const Arg &arg) {
return OK;
}
-Status DebugCommand::main(const std::string &command, const Arg &arg) {
- Status status = parseArgs(command, arg);
+Status DebugCommand::main(const Arg &arg) {
+ Status status = parseArgs(arg);
if (status != OK) {
return status;
}
@@ -49,6 +53,19 @@ Status DebugCommand::main(const std::string &command, const Arg &arg) {
mLshal.err());
}
+void DebugCommand::usage() const {
+
+ static const std::string debug =
+ "debug:\n"
+ " lshal debug <interface> [options [options [...]]] \n"
+ " Print debug information of a specified interface.\n"
+ " <inteface>: Format is `android.hardware.foo@1.0::IFoo/default`.\n"
+ " If instance name is missing `default` is used.\n"
+ " options: space separated options to IBase::debug.\n";
+
+ mLshal.err() << debug;
+}
+
} // namespace lshal
} // namespace android