Debugging info in rt.jar etc.

Discussion in 'Java' started by Pito Salas, May 7, 2004.

  1. Pito Salas

    Pito Salas Guest

    I've searched high and low for a solution to this problem:

    In order to debug a hairy problem, I need to step into some Java system
    classes (hashmap.java) HashMap.class is to be found in rt.jar, part of the
    standard Java distribution (1.4.2_04) but it does NOT have debug info
    compiled in.

    So what to do? I think I did a pretty exhaustive set of steps but I am still
    stumped:

    - I can't locate an rt.jar with debug info
    - From what I read, you can't easily rebuild it from the java system sources
    because some stuff does not compile
    - I tried recompiling hashmap.java with -g to get debug info and putting the
    resulting .class files into a .jar and placing that jar at what I believe is
    the front of the classpath. I did this in Eclipse by adding it as a library
    in the project properties, and then moving it "up" to the front. Didn't seem
    to do it.
    - I tried taking the same built .jar file and putting it into the jre spec
    in
    Eclipse, at the top, and that didn't do the trick either

    Anyone have any ideas? I am totally mystified... Any help would be greatly
    appreciated...

    - Pito
     
    Pito Salas, May 7, 2004
    #1
    1. Advertising

  2. Pito Salas wrote:
    > In order to debug a hairy problem, I need to step into some Java system
    > classes (hashmap.java)


    Hmm, are you sure? Are you claiming you have found a bug in HashMap?

    I am aware of three things which can get you in big trouble with a
    HashMap, all of them not a fault of HashMap:

    - Multithreading. A HashMap is not thread save,

    - changing the key after it has been inserted in the map in a way that
    changes the key object behavior for equals() or hashCode(), and (related)

    - improper implementation of equals() or hashCode() in the key object.

    > - I tried recompiling hashmap.java with -g to get debug info and putting the
    > resulting .class files into a .jar and placing that jar at what I believe is
    > the front of the classpath.


    Change the bootclasspath, not the normal classpath.

    /Thomas
     
    Thomas Weidenfeller, May 7, 2004
    #2
    1. Advertising

  3. Pito Salas

    Pito Salas Guest

    No, I wasn't claiming a bug in HashMap, it's just to understand the bug
    (probably in my code) I needed to see how HashMap was deciding not to find
    something.... It indeed turned out to be a hashCode() error.

    But, still, what is the bootclasspath and can I change it in eclipse as far
    as you know?

    Thanks!

    "Thomas Weidenfeller" <> wrote in message
    news:c7g629$7qj$...
    > Pito Salas wrote:
    > > In order to debug a hairy problem, I need to step into some Java system
    > > classes (hashmap.java)

    >
    > Hmm, are you sure? Are you claiming you have found a bug in HashMap?
    >
    > I am aware of three things which can get you in big trouble with a
    > HashMap, all of them not a fault of HashMap:
    >
    > - Multithreading. A HashMap is not thread save,
    >
    > - changing the key after it has been inserted in the map in a way that
    > changes the key object behavior for equals() or hashCode(), and (related)
    >
    > - improper implementation of equals() or hashCode() in the key object.
    >
    > > - I tried recompiling hashmap.java with -g to get debug info and putting

    the
    > > resulting .class files into a .jar and placing that jar at what I

    believe is
    > > the front of the classpath.

    >
    > Change the bootclasspath, not the normal classpath.
    >
    > /Thomas
     
    Pito Salas, May 8, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold Peters
    Replies:
    0
    Views:
    598
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,754
    muttley
    Oct 20, 2005
  3. cyberco
    Replies:
    4
    Views:
    3,808
    Roedy Green
    Feb 14, 2006
  4. Arnold Peters
    Replies:
    0
    Views:
    681
    Arnold Peters
    Jan 5, 2005
  5. Kevin Walzer

    Re: PIL (etc etc etc) on OS X

    Kevin Walzer, Aug 1, 2008, in forum: Python
    Replies:
    4
    Views:
    431
    Fredrik Lundh
    Aug 13, 2008
Loading...

Share This Page