The availability of a line number for a location will depend on the level of debugging information available from the target VM.
Several mirror interfaces have locations. Each such mirror extends a {@link Locatable} interface.
The source information for a Location is dependent on the stratum which is used. A stratum is a source code level within a sequence of translations. For example, say the baz program is written in the programming language "Foo" then translated to the language "Bar" and finally translated into the Java programming language. The Java programming language stratum is named "Java"
, let's say the other strata are named "Foo" and "Bar". A given location (as viewed by the {@link #sourceName()} and {@link #lineNumber()} methods)might be at line 14 of "baz.foo" in the "Foo"
stratum, line 23 of "baz.bar" in the "Bar"
stratum and line 71 of the "Java"
stratum. Note that while the Java programming language may have only one source file for a reference type, this restriction does not apply to other strata - thus each Location should be consulted to determine its source path. Queries which do not specify a stratum ( {@link #sourceName()}, {@link #sourcePath()} and{@link #lineNumber()}) use the VM's default stratum ( {@link VirtualMachine#getDefaultStratum()}). If the specified stratum (whether explicitly specified by a method parameter or implicitly as the VM's default) is null
or is not available in the declaring type, the declaring type's default stratum is used ( {@link #declaringType()}. {@link ReferenceType#defaultStratum() defaultStratum()}). Note that in the normal case, of code that originates as Java programming language source, there will be only one stratum ("Java"
) and it will be returned as the default. To determine the available strata use {@link ReferenceType#availableStrata()}.
@see com.sun.jdi.request.EventRequestManager
@see StackFrame
@see com.sun.jdi.event.BreakpointEvent
@see com.sun.jdi.event.ExceptionEvent
@see Locatable
@author Robert Field
@author Gordon Hirsch
@author James McIlree
@since 1.3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|