Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Accessing thread stack?

Thread view: 
pelakh@yahoo.com - 29 Mar 2007 04:40 GMT
I have a method that logs on entry (based on a flag), and I would like
to be able to identify the caller in the trace. Now, I can use
Thread.getStackTrace() to get the static thread stack, from which I
can get the invoking class and method. However, I would like to get
hold of the 'this' object reference of the immediate parent stack
frame, so that I can identify the instance of the caller. Is there a
way to do this? The debugging interface seems written to access a
different JVM, and I can't see a way to put it to use.

This code does not have to be very efficient, as it will only be
turned on rarely in fault isolation. Any help is greatly appreciated.
SadRed - 29 Mar 2007 10:42 GMT
On Mar 29, 12:40 pm, pel...@yahoo.com wrote:
> I have a method that logs on entry (based on a flag), and I would like
> to be able to identify the caller in the trace. Now, I can use
[quoted text clipped - 7 lines]
> This code does not have to be very efficient, as it will only be
> turned on rarely in fault isolation. Any help is greatly appreciated.

If I don't mention very special debugging facilities which I do not
know in their details, the plain default JVM or running objects does
not have names of object references nor other names used in the source
code. Names are only handles for compiler to do its work. In thread
dump gotten from Ctrl\ or CtrlBrk, we only see hex address values.
Lew - 29 Mar 2007 13:23 GMT
> If I don't mention very special debugging facilities which I do not
> know in their details, the plain default JVM or running objects does
> not have names of object references nor other names used in the source
> code. Names are only handles for compiler to do its work. In thread
> dump gotten from Ctrl\ or CtrlBrk, we only see hex address values.

Huh, that's funny, you don't see class names and the like?  Maybe the "-g"
compilation option would help.

-- Lew
SadRed - 30 Mar 2007 00:11 GMT
> > If I don't mention very special debugging facilities which I do not
> > know in their details, the plain default JVM or running objects does
[quoted text clipped - 6 lines]
>
> -- Lew

OP is not talking about class name and not the    debugger
information. He just wants to see object reference names on stack
trace.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.