Commit d49750ab authored by Leonard Mosescu's avatar Leonard Mosescu
Browse files

Dex IR builder and entry hooks

The .dex IR is intended to be a lightweight datastructure with minimal
logic embedded into it. The actual .dex image parsing is done by the ir::Reader
and writing new images is done by ir::Writer. For manually altering the .dex IR
is done through the ir::Builder class, which implements the low level interface
for mutating the IR while preserving the IR invariants.

The ir::Builder is used, together with lir::Code to implement bytecode instrumentation
(ir::Builder is used to allocate new method declarations, strings, ... while lir::Code
implements the bytecode IR changes)

Included in this change is a sample bytecode instrumentation: an entry hook which forwards
the incoming arguments to a tracing method. This is mostly a sample and test case, for
the common JVMTI use cases we'll provide a set of higher level helpers to do the common
instrumentation patterns without having to deal with .dex IR or code IR directly.

Test: bazel test :dexter_tests

Change-Id: Idce0cb2a6a70fb334fa19490777efc2eeb084ba4
parent d78ef5d8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment