mauve debugging
Andreas Tobler
toa@pop.agri.ch
Wed Jan 7 15:13:00 GMT 2004
Hi all,
may some of you can use these hints too :)
I never managed to debug mauve testcases, until this afternoon.
If you have any additions or other hints please share.
Andreas
P.S, the example below dates on older sources, so the line numbers might
not be actual anymore.
--------
Here are some steps I did. (credits go partialy to Mark)
Preconditions I have:
A gcc-cvs with a libgcj build plus a mauve-build inside the libjava
testsuite.
Done on powerpc-apple-darwin7.2.0
I start in the libjava/testsuite/mauve-build dir.
The example I take:
gnu.testlet.java.awt.geom.QuadCurve2D.solveQuadratic
First I have to set some environment variables:
setenv PATH /path-to-your-gij:$PATH
setenv PATH /path-to-your-gcj:$PATH
setenv CLASSPATH /path-to-your-libjava-build
setenv CLASSPATH /path-to-your-mauve-build-dir:$CLASSPATH
If necessary set also the
LD_LIBRARY_PATH(linux/*nix)/DYLD_LIBRARY_PATH(darwin)
setenv DYLD_LIBRARY_PATH <path-to-libgcc_s>
setenv DYLD_LIBRARY_PATH <path-to-libgcj>
To run a single test case do:
-----------------------------
# echo "gnu.testlet.java.awt.geom.QuadCurve2D.solveQuadratic" | \
gij gnu.testlet.SimpleTestHarness -verbose -debug
Invoke gdb:
-----------
Now in the mauve-build dir I do:
gdb DejaGnuTestHarness
(gdb) run run gnu.testlet.java.awt.geom.QuadCurve2D.solveQuadratic
Program exited with code 01.
(gdb) b main
Breakpoint 1 at 0x28e0: file /var/tmp//cc0FcCxL.i, line 10.
(gdb) b QuadCurve2D.java:561
Breakpoint 2 at 0x2c9bc0c: file
/Volumes/xufs/gcc-cvs-dylib/gcc/libjava/java/awt/geom/QuadCurve2D.java,
line 561.
(gdb) r
Starting program:
/Volumes/xufs/gcc-cvs-dylib/objdir/powerpc-apple-darwin7.2.0/libjava/testsuite/mauve-build/DejaGNUTestHarness
run gnu.testlet.java.awt.geom.QuadCurve2D.solveQuadratic
Temporarily disabling shared library breakpoints: 2
Re-enabling shared library breakpoints: 2
Breakpoint 1, main (argc=3, argv=0xbffffa8c) at /var/tmp//cc0FcCxL.i:10
10 /var/tmp//cc0FcCxL.i: No such file or directory.
in /var/tmp//cc0FcCxL.i
(gdb) c
Continuing.
Breakpoint 2, java.awt.geom.QuadCurve2D.solveQuadratic(double[],
double[]) (eqn=@e1708, res=@221ca0) at
/Volumes/xufs/gcc-cvs-dylib/gcc/libjava/java/awt/geom/QuadCurve2D.java:561
561 double c = eqn[0];
Note, I did not manage to set a breakpoint in the mauve test itself.
Maybe one of the experts has an idea :)
More information about the Java
mailing list