LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Sun JDK 1.6.0_17 jdb Broken under Fedora 11?? (https://www.linuxquestions.org/questions/linux-software-2/sun-jdk-1-6-0_17-jdb-broken-under-fedora-11-a-778379/)

mejohnsn 12-27-2009 07:55 PM

Sun JDK 1.6.0_17 jdb Broken under Fedora 11??
 
Hard to believe, but that is what it looks like. I would welcome a better explanation though.

I have this dirt simple program that seems to break jdb. That is, I start up the program under jdb, put the execution point at main, say 'next' and the program runs to completion instead of stepping through one high level instruction in the current stack frame!

The program is:
Code:


class KnuthAlgGF2 {
    public static void main(String[] args) {
        int n = 4; // again deferring issue of whence this really should come: n-tuple is -4tuple as on p. 3
        //G1. [Initialize.] set aj<-0 for 0<=j<n; also set ainf <-0
        int[] a = new int[n+1];
        int ainf=0;
        int i=0;          // need outside loop to assign to j
        int j=0;          // Knuth did not initialize here, so neither will I. But this confuses jdb, so now adding init.
        int tmpi=0;

        //G2. [Visit.] Visit the n-tuple (an-1, ... a1, a0)
        // once again, 'visit' means 'print'
        for (tmpi=0;tmpi<5;tmpi++) {
            System.out.println("Current array a is: ");
            for(int k=0;k<n;k++) System.out.print(a[k]);

            }
    }
}

I compile this with "javac -g KnuthAlgGF2", then launch under jdb with either "jdb -launch KnuthAlgGF2" or "jdb KnuthAlgGF2" (then setting breakpoint somewhere). Either way, it ignores the breakpoint, runs to completion and then exits.

What is going on here? Has anyone else encountered a similar problem? Surely nothing in the program should break jdb this badly.

I have neither CLASSPATH nor JAVA_HOME set. But I never heard of that causing this problem, either.

AFAIK, all of 'java', 'javac' and 'jdb' should show up in the PATH only once, in /usr/bin/java, which in turn points to /etc/alternatives, which in turn points to 'usr/java/jdk1.6.0_17/bin/java' (for example).

Or am I confusing jdb with gdb? jdb actually seems to work better if I do NOT compile with the '-g' flag -- necessary for gdb. Is this flag really for 'custom' debug -- whatever that would really mean?

mejohnsn 01-25-2010 12:58 AM

I have not figure out what has since changed, or whether it was all cockpit error in the first place: but I no longer have the problem.


All times are GMT -5. The time now is 11:53 PM.