binder_parcel_fuzzer: dump more info
Dumps more information about the state of the fuzzer in the output, to
aid debugging.
Bug: N/A
Test: binder_parcel_fuzzer
Change-Id: Ib613b7abb68397aeda6c0232cc505bc25589f7d0
diff --git a/libs/binder/fuzzer/main.cpp b/libs/binder/fuzzer/main.cpp
index 369aa34..31b27ab 100644
--- a/libs/binder/fuzzer/main.cpp
+++ b/libs/binder/fuzzer/main.cpp
@@ -36,12 +36,17 @@
for (size_t i = 0; i < instructions.size() - 1; i += 2) {
uint8_t a = instructions[i];
+ uint8_t readIdx = a % reads.size();
+
uint8_t b = instructions[i + 1];
- FUZZ_LOG() << "size: " << p.dataSize() << " avail: " << p.dataAvail()
- << " pos: " << p.dataPosition() << " cap: " << p.dataCapacity();
+ FUZZ_LOG() << "Instruction: " << (i / 2) + 1 << "/" << instructions.size() / 2
+ << " cmd: " << static_cast<size_t>(a) << " (" << static_cast<size_t>(readIdx)
+ << ") arg: " << static_cast<size_t>(b) << " size: " << p.dataSize()
+ << " avail: " << p.dataAvail() << " pos: " << p.dataPosition()
+ << " cap: " << p.dataCapacity();
- reads[a % reads.size()](p, b);
+ reads[readIdx](p, b);
}
}