Information about tptp [message #124136] |
Mon, 25 February 2008 09:10  |
Eclipse User |
|
|
|
Originally posted by: biscio81.tiscali.it
i would have some informations about TPTP.
I'm a student of the "University of Salerno" (Italy) and i'm getting
the degree in Computer Science. My name is Marco.
I would know if is possible with TPTP retrieve the class that call the
method monitored.
Example:
We have two classes, MyClass and Class. The MethodA of the class MyClass
call the MethodB of the class Class.
public class MyClass{
public void MethodA(){
Class cl= new Class()
cl.MethodB()
}
}
public class Class{
public void MethodB(){
}
}
I want this information:
The class MyClass call the method MethodB of the class Class
Waiting for a your response.
Best regards,
Marco Biscione, Salerno, Italy
|
|
|
|
|
Re: Information about tptp [message #125021 is a reply to message #124301] |
Sun, 02 March 2008 04:10  |
Eclipse User |
|
|
|
Marco wrote:
> hi Asaf
> I must retrive the information i need by using the probekit of TPTP.
> Is it possible?
> I succeed to retrive with probekit the method name monitored and the class
> name that method belong to. I need to retrive the class name that call the
> method monitored.
You can a combination of "entry" and "beforeCall" probes to get
information on both the invoked method ("entry" probe) and the invoking
method ("beforeCall"). Please check the TPTP online help for more
information.
If you need to capture entire stack trace (i.e., method call chain)
leading to a specific method invocation, you can "abuse" the Java
exception mechanism in your "entry" probe by instantiating an Exception
object and obtaining its tack trace.
Here's an example code you can use inside an "entry" probe:
....
Exception e = new Exception();
StackTraceElement[] stackTrace = e.getStackTrace();
....
HTH,
Asaf
--
Asaf Yaffe
Eclipse TPTP Committer, JVMTI Profiler
|
|
|
Powered by
FUDForum. Page generated in 0.10254 seconds