Debugging info in rt.jar etc.

P

Pito Salas

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
 
T

Thomas Weidenfeller

Pito said:
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
 
P

Pito Salas

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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top