The jdb list command will not find source files that are present in the user's classpath. The default path for the "use" command should include these directories.
Name: tb29552 Date: 12/19/2000
orig synopsis: 'jdb fails to "list" source when I compile with a specific "source path" pattern'
java version "1.2"
Classic VM (build JDK-1.2-V, native threads)
This behaviour pattern applies to "any" source code.
Do the following steps (exactly).
1. Create a package (say) foo.bar
2. Assume class Bar in foo.bar package (with some code!
3. javac -g foo/bar/Bar.java (From within the parent of foo - and NOTICE
the "/").
4. Then do jdm foo.bar.Bar
5. At the jdb prompt set a break point at some line number (say 36) using "stop
at foo.bar.Bar:36"
6. "run" and wait for the brak point to be "hit"
7. Now do "list"
Now jdb complains of "Source file not found: foo/bar/Bar.java"
The problem appears to be because of the path to the source file represented
with "/" rather than "\". This is proved by doing step 3 above with "\" - then
the problem disappears.
Also, the problem does not surface if (for example) you have a Driver class in
your curernt directory ( parent of foo) and you do "jdb Driver" ( even if you
have compiled using "/" in the command line) !.
(Review ID: 109109)
======================================================================
Name: tb29552 Date: 12/19/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
I have an application that has a root source file in a directory calling members
of a package in a subdirectory.
Starting the jdb debugger on the top level member the debugger can trace and
reports source code lines correctly. Stepping into objects in the package causes
the debugger to be unable to find the source code of the objects in the package,
which are in the subdirectory.
Sample output from jdb:
Breakpoint hit: thread="main", jct.Trfr.trLogon(), line=929, bci=81
main[1] list
Source file not found: jct/Trfr.java
No "use" command format that I have been able to try (and I've tried quite a few
variants!) appears to be able to set the source path to enable the jdb to trace
the source of these objects.
This makes the debugger virtually unusable.
(Review ID: 110243)
======================================================================
Name: tb29552 Date: 12/19/2000
E:\Data\CORBA\PuB_tests\ORBacus\PuB>java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
E:\Data\CORBA\PuB_tests\ORBacus\PuB>jdb -version
jdb version 99/06/11
I tried to set the sourcepath in the jdb w/o success (w/jdk1.2.2 it works)
E:\Data\CORBA\PuB_tests\ORBacus\PuB>jdb
Initializing jdb...
> use
.
> use aPath
> use
.
>
I also have the problem, that my sourcefiles are not found, even if the path "."
is correct. the jdb tells me, that it can't find the file, providing the correct
path...
E:\Data\CORBA\PuB_tests\ORBacus\PuB>make run2d
jdb -sourcepath ".;//e/data" -launch -Dorg.omg.CORBA.ORBClass=com.ooc.CORBA.ORB
-Dorg.omg.CORBA.ORBSingletonClass=com.ooc.CORBA.ORBSingleton
com/obtree.pub.PuBimpl.ISIJ2client
Java HotSpot(TM) Client VM warning: Setting of property "java.compiler" is
ignored
Initializing jdb...
>
VM Started: No frames on the current call stack
main[1] step
main[1]
Step completed: thread="main", com.obtree.pub.PuBimpl.ISIJ2client.<clinit>(),
line=56, bci=0
main[1] list
Source file not found: ./source/client/ISIJ2client.java
main[1] Input stream closed.
E:\Data\CORBA\PuB_tests\ORBacus\PuB>ls ./source/client/ISIJ2client.java
./source/client/ISIJ2client.java
The jdb can't find my sourcefile, even if it tries the right file.
(Review ID: 114028)
======================================================================
Name: tb29552 Date: 12/19/2000
orig synopsis: 'jdb fails to "list" source when I compile with a specific "source path" pattern'
java version "1.2"
Classic VM (build JDK-1.2-V, native threads)
This behaviour pattern applies to "any" source code.
Do the following steps (exactly).
1. Create a package (say) foo.bar
2. Assume class Bar in foo.bar package (with some code!
3. javac -g foo/bar/Bar.java (From within the parent of foo - and NOTICE
the "/").
4. Then do jdm foo.bar.Bar
5. At the jdb prompt set a break point at some line number (say 36) using "stop
at foo.bar.Bar:36"
6. "run" and wait for the brak point to be "hit"
7. Now do "list"
Now jdb complains of "Source file not found: foo/bar/Bar.java"
The problem appears to be because of the path to the source file represented
with "/" rather than "\". This is proved by doing step 3 above with "\" - then
the problem disappears.
Also, the problem does not surface if (for example) you have a Driver class in
your curernt directory ( parent of foo) and you do "jdb Driver" ( even if you
have compiled using "/" in the command line) !.
(Review ID: 109109)
======================================================================
Name: tb29552 Date: 12/19/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
I have an application that has a root source file in a directory calling members
of a package in a subdirectory.
Starting the jdb debugger on the top level member the debugger can trace and
reports source code lines correctly. Stepping into objects in the package causes
the debugger to be unable to find the source code of the objects in the package,
which are in the subdirectory.
Sample output from jdb:
Breakpoint hit: thread="main", jct.Trfr.trLogon(), line=929, bci=81
main[1] list
Source file not found: jct/Trfr.java
No "use" command format that I have been able to try (and I've tried quite a few
variants!) appears to be able to set the source path to enable the jdb to trace
the source of these objects.
This makes the debugger virtually unusable.
(Review ID: 110243)
======================================================================
Name: tb29552 Date: 12/19/2000
E:\Data\CORBA\PuB_tests\ORBacus\PuB>java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
E:\Data\CORBA\PuB_tests\ORBacus\PuB>jdb -version
jdb version 99/06/11
I tried to set the sourcepath in the jdb w/o success (w/jdk1.2.2 it works)
E:\Data\CORBA\PuB_tests\ORBacus\PuB>jdb
Initializing jdb...
> use
.
> use aPath
> use
.
>
I also have the problem, that my sourcefiles are not found, even if the path "."
is correct. the jdb tells me, that it can't find the file, providing the correct
path...
E:\Data\CORBA\PuB_tests\ORBacus\PuB>make run2d
jdb -sourcepath ".;//e/data" -launch -Dorg.omg.CORBA.ORBClass=com.ooc.CORBA.ORB
-Dorg.omg.CORBA.ORBSingletonClass=com.ooc.CORBA.ORBSingleton
com/obtree.pub.PuBimpl.ISIJ2client
Java HotSpot(TM) Client VM warning: Setting of property "java.compiler" is
ignored
Initializing jdb...
>
VM Started: No frames on the current call stack
main[1] step
main[1]
Step completed: thread="main", com.obtree.pub.PuBimpl.ISIJ2client.<clinit>(),
line=56, bci=0
main[1] list
Source file not found: ./source/client/ISIJ2client.java
main[1] Input stream closed.
E:\Data\CORBA\PuB_tests\ORBacus\PuB>ls ./source/client/ISIJ2client.java
./source/client/ISIJ2client.java
The jdb can't find my sourcefile, even if it tries the right file.
(Review ID: 114028)
======================================================================
- duplicates
-
JDK-4303597 JDB Sourcepath not set up correctly
-
- Closed
-
- relates to
-
JDK-4421108 TTY: jdb sourcepath does not reflect changed value
-
- Closed
-