summaryrefslogtreecommitdiff
path: root/cmds/lshal/DebugCommand.cpp
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2018-01-19 22:50:47 +0000
committer android-build-merger <android-build-merger@google.com> 2018-01-19 22:50:47 +0000
commit0cc1febdc672a7a4d11c159f2a426ee6e303fb1c (patch)
treef478300046ab274b9e8e4d78ec6013eb243ad523 /cmds/lshal/DebugCommand.cpp
parent0f4b0d31bbc81977cc77f65c6139d60b4d821c33 (diff)
parent7c41e701ab76a9126efd9eb95f25d11b8a017ecb (diff)
Merge "Add 'exclude parent' option to debug." am: 7fb0aa5f97 am: 078d9bb83e
am: 7c41e701ab Change-Id: Ie6d5199cc551e05895ecdad7a86a1205be669366
Diffstat (limited to 'cmds/lshal/DebugCommand.cpp')
-rw-r--r--cmds/lshal/DebugCommand.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/cmds/lshal/DebugCommand.cpp b/cmds/lshal/DebugCommand.cpp
index f371320bd0..dd8812d5bf 100644
--- a/cmds/lshal/DebugCommand.cpp
+++ b/cmds/lshal/DebugCommand.cpp
@@ -35,6 +35,14 @@ Status DebugCommand::parseArgs(const Arg &arg) {
if (optind >= arg.argc) {
return USAGE;
}
+
+ // Optargs cannnot be used because the flag should not be considered set
+ // if it should really be contained in mOptions.
+ if (std::string(arg.argv[optind]) == "-E") {
+ mExcludesParentInstances = true;
+ optind++;
+ }
+
mInterfaceName = arg.argv[optind];
++optind;
for (; optind < arg.argc; ++optind) {
@@ -59,6 +67,7 @@ Status DebugCommand::main(const Arg &arg) {
return mLshal.emitDebugInfo(
pair.first, pair.second.empty() ? "default" : pair.second, mOptions,
+ mExcludesParentInstances,
mLshal.out().buf(),
mLshal.err());
}
@@ -67,8 +76,9 @@ void DebugCommand::usage() const {
static const std::string debug =
"debug:\n"
- " lshal debug <interface> [options [options [...]]] \n"
+ " lshal debug [-E] <interface> [options [options [...]]] \n"
" Print debug information of a specified interface.\n"
+ " -E: excludes debug output if HAL is actually a subclass.\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";