Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc449dc7 authored by Steven Moreland's avatar Steven Moreland
Browse files

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
parent b92c27b6
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -36,12 +36,17 @@ void doFuzz(

    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);
    }
}