Granary / granary2

Dynamic binary translation framework for instrumenting x86-64 user space Linux programs
MIT License
39 stars 5 forks source link

Add `lir::ConvertCallToJump`, and add `ControlFlowInstruction::IsFunctionTailCall`. #31

Closed pgoodman closed 10 years ago

pgoodman commented 10 years ago

Add a helper function lir::ConvertCallToJump, and make it just do a JMP_RELBRd on the internal ControlFlowInstruction::instruction. Also add in a is_tail_call to ControlFlowInstruction so that other tools can detect when this transformation has happened. E.g. this way tools can see when the transparent_returns tool has converted a function call into a jump.

pgoodman commented 10 years ago

These would fit nicely into clients/util.

pgoodman commented 10 years ago

Next commit will partially resolve this, as it introduces a lir::ConvertFunctionCallToJump and a lir::ConvertJumpToFunctionCall.

Also renames lir::Call to lir::FunctionCall to improve consistency with NativeInstruction::IsFunctionCall.

pgoodman commented 10 years ago

Done with the is_tail_call.