Skip to content

Cali is a CAll Log Instrumentor based on Javassist

License

Notifications You must be signed in to change notification settings

prog2-unimi/cali

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calì

Calì is a quick and dirty implementation of a call log instrumentator based on javassist that modifies existing classes adds a print statement reporting the (fully qualified) method name and actual parameters of selected methods of a given class.

Usage

Assuming that the fat jar of this tool is build/libs/cali-0.1.0.jar and that your classes have been compiled in build/classes/java/test, the invocation

java -cp build/libs/cali-0.1.2.jar:build/classes/java/main it.unimi.di.prog2.cali.Cali it.unimi.di.prog2.example.Example twice

produces the output

Instrumented method it.unimi.di.prog2.example.Example.twice(int)
Instrumented method it.unimi.di.prog2.example.Example.twice(double)

meaning that all the methods called twice of the Example class have been instrumented; the modified code is written in build/classes/java/instrumented so that the following invocation

java -cp build/classes/java/instrumented it.unimi.di.prog2.example.Example

produces the output

it.unimi.di.prog2.example.Example.twice(3)
6
it.unimi.di.prog2.example.Example.twice(1.5)
3.0

in which odd lines are the call logging inserted by cali.

About

Cali is a CAll Log Instrumentor based on Javassist

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages