2

I'm currently trying to develop a java agent to get stack traces with the name of the called method and values passed by the method. I have a simple application which creates some instances of different objects and plays with them to test my java agent.

Oh and I'm using BCEL too.

For now, all I can get is all Classes with methods and attributes.

Here is the code of the java agent: http://pastebin.com/HFkgswJH

Here is what I get when I run: java -javaagent:instr.jar bookStore.jar : http://pastebin.com/gsjat72E

So, how can I get a trace when a method is called? For example, If in my simple Application I do:

Book myBook = new Book("Title", "Author", "Thriller");

myBook.setTitle("This is Funny");

I would like to get the method name "setTitle" and the String value passed: "This is Funny!"

Any ideas? link? library?

Thanks!

Community
  • 1
  • 1
kdelemme
  • 333
  • 1
  • 7
  • 20

0 Answers0