get file name in tty

hi all,

i am modifying tty now.

i need to get java file name from tty.

i.e. print following info:

line=37, com.user.MyClass.getType(), MainClass.java

line number and class.method (here is line=37, com.user.MyClass.getType) can be obtained from instance of Location

but i can not find how to obtain java file name (here is MainClass.java).

could u show me which class (similar to class Location) is used to get the info?

thx

[478 byte] By [soso0000a] at [2007-9-29 20:07:21]
# 1

If you have the Location, how about using the com.sun.jdi.Location.sourceName() method?

For an example, take a look at the SourceMapper.java file,

which is part of the example code in:

demo/jpda/com/sun/tools/example/debug/tty

The SourceMapper class is used by jdb when the user

is at a breakpoint and enters a 'list' command to see the

source code at that Location.

debugging_teama at 2007-7-16 0:20:59 > top of Java-index,Archived Forums,Debugging Tools and Techniques...