@@ -105,36 +105,31 @@ Identifying the location of source code
105
105
One goal of the implementation is to make it simple to configure your
106
106
debugger so that it can identify the relevant source file when it
107
107
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.
110
109
111
110
The native image generator uses different strategies to locate source
112
111
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.
118
113
119
114
Sources for JDK runtime classes are retrieved from the src.zip found
120
115
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
123
118
define the directory hierarchy in which the source is located.
124
119
125
120
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
127
122
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
130
125
'\' rather than '/' as the file separator.
131
126
132
127
Sources for GraalVM classes are retrieved from zip files or source
133
128
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
135
130
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 ` ).
138
133
139
134
The lookup scheme for cached GraalVM sources varies depending upon
140
135
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
144
139
directories /path/to/bar/src and /path/to/bar/src_gen are considered
145
140
as candidates. Candidates are skipped when i) the zip file or source
146
141
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
148
143
package hierarchies.
149
144
150
145
Sources for application classes are retrieved from source jar files or
151
146
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
153
148
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 ` ).
156
151
157
152
The lookup scheme for cached Application sources varies depending upon
158
153
what is found in each classpath entry. Given a jar file entry like
@@ -174,30 +169,26 @@ configure extra source search paths (see below).
174
169
Configuring source paths in gdb
175
170
-------------------------------
176
171
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
179
174
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
181
176
following command:
182
177
183
- (gdb) set directories /path/to/sources/jdk:/path/to/sources/graal:/path/to/sources/src
178
+ (gdb) set directories /path/to/sources
184
179
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.
187
187
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
198
189
application source jars or copying application source trees into the
199
190
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
201
192
sources are being included.
202
193
203
194
You can also add extra directories to the search path using the 'set
0 commit comments