This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
debugging java code with multiple source files
- To: gdb-help at sources dot redhat dot com, java at gcc dot gnu dot org
- Subject: debugging java code with multiple source files
- From: stefan dot wanner at ntb dot ch (Wanner Stefan)
- Date: Fri, 02 Nov 2001 16:52:21 +0100
hello
i have problems debugging java programs which belong to a package AND
use CNI. i'm using gcj from the cvs tree and gdb from the cvs tree as well.
i type this:
#gcj -C -g bar.java
#gcj -c -g bar.class -o bar.o
#gcj -C -g foo.java
#gcj -c -g foo.class -o foo.o
#gcj -g --static --main=foo bar.o \
bar2.o foo.o -o foo
situation 1: compiled with gcj on a x86
debugging works fine.
situation 2:
crosscompiled on a x86 for powerpc with powerpc-linux-gcj
when i try to open bar.java or bar2.java in gdb i get this error:
#gdb-ppc foo
...
(gdb) list foo.java
the class foo does not have any method named java
Hint: try 'foo.java<TAB> or 'foo.java<ESC-?>
(Note leading single quote.)
(gdb) list foo.java:1
1
public class foo{
2
public static void main(String args[]){
3
bar b = new bar();
4
b.x();
5
bar2 b2 = new bar2();
6
b2.x();
7
}
8
}
9
(gdb) list bar.java
the class bar does not have any method named java
Hint: try 'bar.java<TAB> or 'bar.java<ESC-?>
(Note leading single quote.)
(gdb) list bar.java:1
No source file named bar.java.
(gdb)
the problem is a bit strange.with a single file program it's no problem.
when i compile this all the source together it works also with
crosscompiling:
powerpc-linux-gcj --main=foo -g --static foo.java bar.java \
bar2.java -o foo
but i need separate compiling because i also have to use CNI and C code
in my program.
thanks for helping!
stefan wanner