Skip to content

Commit 2642015

Browse files
committed
Update documentation to reflect unified-cache and oracle#2752 changes
1 parent a83e37c commit 2642015

File tree

1 file changed

+27
-36
lines changed

1 file changed

+27
-36
lines changed

substratevm/DEBUGINFO.md

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -105,36 +105,31 @@ Identifying the location of source code
105105
One goal of the implementation is to make it simple to configure your
106106
debugger so that it can identify the relevant source file when it
107107
stops during program execution. The native image generator tries to
108-
achieve this by accumulating the relevant sources in a suitably
109-
structured file cache.
108+
achieve this by accumulating the relevant sources in a file cache.
110109

111110
The native image generator uses different strategies to locate source
112111
files for JDK runtime classes, GraalVM classes and application source
113-
classes for inclusion in the local sources cache. It identifies which
114-
strategy to use based on the package name of the class. So, for
115-
example, packages starting with java.* or jdk.* are JDK classes;
116-
packages starting with org.graal.* or com.oracle.svm.* are GraalVM
117-
classes; any other packages are regarded as application classes.
112+
classes for inclusion in the local sources cache.
118113

119114
Sources for JDK runtime classes are retrieved from the src.zip found
120115
in the JDK release used to run the native image generation process.
121-
Retrieved files are cached under subdirectory sources/jdk, using the
122-
module name (for JDK11) and package name of the associated class to
116+
Retrieved files are cached under subdirectory _sources_, using the
117+
package name of the associated class to
123118
define the directory hierarchy in which the source is located.
124119

125120
So, for example, on Linux the source for class java.util.HashMap will
126-
be cached in file sources/jdk/java.base/java/util/HashMap.java. Debug
121+
be cached in file _sources/java/util/HashMap.java_. Debug
127122
info records for this class and its methods will identify this source
128-
file using the relative directory path java.base/java/util and file
129-
name HashMap.java. On Windows things will be the same modulo use of
123+
file using the relative directory path _java/util_ and file
124+
name _HashMap.java_. On Windows things will be the same modulo use of
130125
'\' rather than '/' as the file separator.
131126

132127
Sources for GraalVM classes are retrieved from zip files or source
133128
directories derived from entries in the classpath. Retrieved files are
134-
cached under subdirectory sources/graal, using the package name of the
129+
cached under subdirectory _sources_, using the package name of the
135130
associated class to define the directory hierarchy in which the source
136-
is located (e.g. class com.oracle.svm.core.VM has its source file
137-
cached at sources/graal/com/oracle/svm/core/VM.java).
131+
is located (e.g. class `com.oracle.svm.core.VM` has its source file
132+
cached at `sources/com/oracle/svm/core/VM.java`).
138133

139134
The lookup scheme for cached GraalVM sources varies depending upon
140135
what is found in each classpath entry. Given a jar file entry like
@@ -144,15 +139,15 @@ be extracted. When the entry specifies a dir like /path/to/bar then
144139
directories /path/to/bar/src and /path/to/bar/src_gen are considered
145140
as candidates. Candidates are skipped when i) the zip file or source
146141
directory does not exist or ii) it does not contain at least one
147-
subdirectory hierarchy that matches one of the the expected GraalVM
142+
subdirectory hierarchy that matches one of the expected GraalVM
148143
package hierarchies.
149144

150145
Sources for application classes are retrieved from source jar files or
151146
source directories derived from entries in the classpath. Retrieved
152-
files are cached under subdirectory sources/src, using the package
147+
files are cached under subdirectory _sources_, using the package
153148
name of the associated class to define the directory hierarchy in
154-
which the source is located (e.g. class org.my.foo.Foo has its
155-
source file cached as sources/src/org/my/foo/Foo.java).
149+
which the source is located (e.g., class `org.my.foo.Foo` has its
150+
source file cached as `sources/org/my/foo/Foo.java`).
156151

157152
The lookup scheme for cached Application sources varies depending upon
158153
what is found in each classpath entry. Given a jar file entry like
@@ -174,30 +169,26 @@ configure extra source search paths (see below).
174169
Configuring source paths in gdb
175170
-------------------------------
176171

177-
By default gdb will employ the three local directory roots
178-
`sources/{jdk,graal,src}` to locate the source files for your app classes, Graal
172+
By default gdb will employ the `sources` directory
173+
to locate the source files for your app classes, Graal
179174
classes and JDK runtime classes. If the sources cache is not located in the
180-
directory in which you run gdb you can configure the required paths using the
175+
directory in which you run gdb you can configure the required path using the
181176
following command:
182177

183-
(gdb) set directories /path/to/sources/jdk:/path/to/sources/graal:/path/to/sources/src
178+
(gdb) set directories /path/to/sources
184179

185-
Directory `/path/to/sources/jdk` should contain source files for all JDK runtime
186-
classes referenced from debug records.
180+
where directory `/path/to/sources` should contain source files for:
181+
1. all JDK runtime classes referenced from debug records.
182+
2. all GraalVM classes referenced from debug records. Note that the current
183+
implementation does not yet find some sources for the GraalVM JIT
184+
compiler in the org.graalvm.compiler* package subspace.
185+
3. all application classes referenced from debug records, assuming they can
186+
be located using the lookup strategy described above.
187187

188-
Directory `/path/to/sources/graal` should contain source files for all GraalVM
189-
classes referenced from debug records. Note that the current
190-
implementation does not yet find some sources for the GraalVM JIT
191-
compiler in the org.graalvm.compiler* package subspace.
192-
193-
Directory `/path/to/sources/src` should contain source files for all
194-
application classes referenced from debug records, assuming they can
195-
be located using the lookup strategy described above.
196-
197-
You can supplement the files cached in `sources/src` by unzipping
188+
You can supplement the files cached in `sources` by unzipping
198189
application source jars or copying application source trees into the
199190
cache. You need to ensure that any new subdirectory you add to
200-
`sources/src` corresponds to the top level package for the classes whose
191+
`sources` corresponds to the top level package for the classes whose
201192
sources are being included.
202193

203194
You can also add extra directories to the search path using the 'set

0 commit comments

Comments
 (0)