Getting an Object Identifier String given a line of source code? HELP!
(forgot to close the code tag on that last one!)
Hi there,
I am in desparate need of getting the object identifier given a particular line of source code. I need this for the debugger I'm writing, and since the jdb forum never gets reponses; just more unanswered questions.
Right so, here's my problem in more detail. I can find out when a method is called in the Java virtual machine, and what its name is, and arguments and values and such like - using the Java Debugging Interface. BUT: unfortunately I cannot get the object identifier used in the source code that generated this call. I can however get a unique long id that identifies this object .. if that helps?(thinking hashtables here maybe?!)
So, I may know that the constructor of EddClass has been called, and this the following line generated this call:
EddClass edd =new EddClass();
.. so what I need is a fail safe way of finding out "edd" from this - given all types of method calls.
This is quite tricky because there are loads of ways methods can be called e.g.
tty.getClassExclusions();// Here I would know getClassExclusions had been called, and I would need to find out the object identifier "tty" called it
Temp a, b, c;
a = b = c =new Temp();// Here I would know the constructor for Temp had been called, but now I would just want to know "c"
AnotherEg ae = (new Egg()).getAnotherEg();// and in this last case if I had found out that the Egg constructor had been called, I don't want to find out any object identifier from this line of code - since the object is anonymous; however if I had found out that getAnotherEg() had been called I would want "ae"
Ok, well - please help: I'm making a Java Animator that will be freely available - that serves to graphically animate the execution of another java program. It'd be cool if one of you guys could help make it really cool. Plus there are Dukes available!!
- Edd.

