• Post Reply Bookmark Topic Watch Topic
  • New Topic

Do I know what method is executing ?  RSS feed

 
Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to write code to print out the methodname which I am executing in.

e.g.In pseudoJava


Possible ?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
 
Arjun K
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear PHO,

Do U need this for debugging purpose; if so then there is an interface named JDI(Java Debug Interface). With the help of that interface you can set events for exception(s) happening or method event happening on an instance or object.

Look into the below link: I agree that the usage of this interface is not from scratch. These interfaces are contained in JPDA(Java Platform Debugger Architecture) which will contained in tools.jar.

http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdi/index.html

Let me know if you need any thing else.

-Arjun.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!