Skip to main content

rt.jar with debug symbols

21 replies [Last post]
cowwoc
Offline
Joined: 2003-08-24
Points: 0

I feel it would be invaluable to be able to get line numbers with stack-traces when an exception is thrown by JRE code. Can you make rt.jar with debugging symbols available for Tiger update 1 and Mustang?

I don't have the capability of rebuilding Tiger myself.

Thanks,
Gili

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ziesemer
Offline
Joined: 2006-10-11
Points: 0

Dmitri (trembovetski) / kellyohair -

Could you please clarify the status on all of this? I see there are 2 "work-arounds" being tossed about - either build the debug version yourself, or possibly download one. Unfortunately, neither seems quite up-to-par, yet...

As for the download, I see everything on http://download.java.net/jdk6/binaries/ is still "rc" (release candidate?), and is b104. I'm currently running SDK 1.6.0-b105. What are the chances being able to get a matched debug download along with the latest official SDK release?

As for doing a custom build, setting up the environment is not the easiest or quickest task. Also, as I understand, this requires the SCSL source, as the JRL contains a number of empty stubs. I found the JRL download for 1.6, but everything for SCSL appears to be at http://www.sun.com/software/communitysource/j2se/java2/download.xml, and there is no 1.5 listed. Also, with any of the source downloads, how can we be assured we're getting the version that matches a given release? For example, is that source for "1.5" for 1.5 Update 10, Update 9, or otherwise?

Thanks!

trembovetski
Offline
Joined: 2003-12-31
Points: 0

I'm assuming the jdk6 binaries should be updated, not sure
why they weren't. May be Kelly knows?

But there were only very minor changes between b104 and
b105, so for your immediate debugging purposes it should
work (as a temp workaround).

You don't need SCSL bundles to build a complete jdk,
whatever is available under JRL is sufficient. But I agree
that it's not easy to build.

I'm assuming that the available SCSL bundles are for the
latest available release (5.0u10).

Thanks,
Dmitri

ziesemer
Offline
Joined: 2006-10-11
Points: 0

Dmitri - thanks for your quick response!

Agreed, the b104 works as an immediate workaround, it's just not best practice.

I'll double-check the JRL-licensed files. My concern may have been in non-rt.jar libraries, e.g. JSSE.jar.

Just a consideration - say I am asked to debug an application under a specific version of the JRE. It'd be nice to have pre-compiled debug-enabled libraries available for any of the versions that are available in the download archive.

As a side-note, I found another possibly-helpful method for working with all of this. Most of my reluctance against the existing work-arounds using special rt.jar builds was that none result in a matching build as the official release. For example, none of the sun.* or packages had source available or would compile correctly.

At the moment, I seem quite happy with just using the source files supplied in src.zip with the JDK, and making my own rt_debug.jar with the files that DO successfully compile, then using a custom system library path for the runtime, putting this just before the default rt.jar. This way, I know the source exactly matches the runtime I'm using. I can even process all the source code through the Eclipse code formatter, for example, so that everything is perfectly indented and easier to read when I do debug. (The source and generated .class files can even be kept together in the same .jar.) Hopefully this helps someone else, too...

Thanks again!

trembovetski
Offline
Joined: 2003-12-31
Points: 0

Ziesemer:

that may be a decent workaround, which should work for most.

After asking around I was told that we should be providing a debug version of b105, but the difference between 104 and 105 is minimal (some version strings, that's it), so you may as well just use the fastdebug bundle for 104.

Thanks,
Dmitri

kfurnell
Offline
Joined: 2006-08-31
Points: 0

Is there a corresponding download available anywhere for 1.5.0 ?

johnrsisson
Offline
Joined: 2005-02-20
Points: 0

Good to see there are some discussions going on about this issue, as I tried to raise awareness of it on javalobby recently (before I discovered these forums).. http://www.javalobby.org/forums/thread.jspa?threadID=17349&messageID=918...

I would like to be able to download a full debug rt.jar (line numbers and local variables) along with the JDK from the normal JDK download page.

Any chance it could also be done for future JDK 1.4.2 & 1.5 builds to assist developers with debugging?

ndesjardins
Offline
Joined: 2005-07-11
Points: 0

Hi Bino,

I would also love to have access to all local variables. Unfortunately, building the jdk from the SCSL sources on Linux requires GCC 2.9.1. Due to compatibility issues, I don't have the option of installing anything higher than GCC 2.9 on my development platform. (Frankly, I also don't have the patience to start hunting down all kinds of Linux dependencies.)

Having a pre-built rt.jar with all the debug information available for download would be infinitely helpful and appreciated.

Thanks,
Nick

vijayj
Offline
Joined: 2004-10-26
Points: 0

Hi,

I am working on getting our fastdebug bundles out to java.net site. rt.jar in the fastdebug bundle has both line numbers and local variables. Currently I don't have any target date for this but expect something before this month.

Thanks,
Vijayan.

cowwoc
Offline
Joined: 2003-08-24
Points: 0

Any update?

Gili

nagarajsk
Offline
Joined: 2007-03-23
Points: 0

How to download rt.jar file.. means where i ll get?

kellyohair
Offline
Joined: 2004-09-03
Points: 0

So with B28, if you build it, the rt.jar built for the fastdebug build is a fat rt.jar (all local variable information is included). We don't have that rt.jar file available to download yet, or the fastdebug build.
As soon as we have disk space available I'd like to see us provide the entire fastdebug build bundles (fast java_g version).
Let us know if this sounds of interest so I can justify the use of the disk space.

cowwoc
Offline
Joined: 2003-08-24
Points: 0

There are 86 votes for http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4652184 so obviously there is quite a bit of interest.

Where can we download the fat rt.jar?

trembovetski
Offline
Joined: 2003-12-31
Points: 0

Um, the fastdebug binary contains debug rt.jar..

Thanks,
Dmitri

cowwoc
Offline
Joined: 2003-08-24
Points: 0

I'm not sure I understand, where does one download the fastdebug binary? The only thing I found was something called a "debug jar" clocking in at over 80MB here: http://download.java.net/jdk6/binaries/

Is this what you were referring to or is there a better source?

Thanks,
Gili

trembovetski
Offline
Joined: 2003-12-31
Points: 0

Hi Gili,

sorry for not being clear.

Yes, you download the debug jar file for your platform. For example,
http://download.java.net/download/jdk6/binaries/jdk-6-beta2-bin-b74-wind...

contains a debug version of the jdk for windows-i586. It's called 'fastdebug' because it's compiled with some optimizations while still having the debug symbols.

This version of the jdk contains a debug version of the rt.jar .

Thanks,
Dmitri

cowwoc
Offline
Joined: 2003-08-24
Points: 0

Thanks Dmitri, it's all clear now :)

timbell
Offline
Joined: 2003-06-10
Points: 0

You wrote:

> I feel it would be invaluable to be able to
> get line numbers with stack-traces when an
> exception is thrown by JRE code.

Plenty of room for confusion here.

The rt.jar shipped with the JRE is stripped to
minimize download size.

The rt.jar shipped with the SDK has line number
information in it, but not local variables.

So, if you want more information in stack traces,
run with the full SDK installation.

Shipping a full debug rt.jar in some kind of
development pack is Bug Id: 4652184
Synopsis: please compile j2sdk rt.jar with -g (all
options)

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4652184

cowwoc
Offline
Joined: 2003-08-24
Points: 0

timbell,

Your answer was very helpful. Thank you!

Sun: This should be documented somewhere, really! :)

Gili

bino_george
Offline
Joined: 2003-06-16
Points: 0

Hi Gili,

> symbols available for Tiger update 1 and Mustang?
>
> I don't have the capability of rebuilding Tiger
> myself.

Have you tried building Tiger or Mustang ? We are eager to
hear about any issues you are running into. If you did
build Mustang yourself, you can enable debug information
in the java class files by using the flag DEBUG_CLASSES.

Example :

gnumake DEBUG_CLASSES=true

As to your point about shipping two sets of binaries, with
and without the debug information, it just takes more
resources to keep the files around. But I can see why it
would be very useful.

Thanks,
Bino.

kellyohair
Offline
Joined: 2004-09-03
Points: 0

Well I'm a little confused by this thread. I thought rt.jar did have all the debug line number information in all it's classes, but did not have the information about the local variables. If that's not the case perhaps I need to find that out.

As far as a fat rt.jar that has ALL debugging information, both line and local variable information, the DEBUG_CLASSES=true is the right flag to use.

We are working on some build changes that will allow for the debug builds to have their own rt.jar file, and if the size and time it takes to build a fat rt.jar file isn't too bad, we could do it by default in debug builds. But I haven't got the data yet. If having this fat rt.jar in the debug builds is of interest, let me know.

(Of course someone could easily copy a debug rt.jar into a product build in case they didn't want the debug VM overhead).

cowwoc
Offline
Joined: 2003-08-24
Points: 0

It might make sense to always ship the JDK with debugging symbols enabled and the JRE with debugging symbols stripped.

That is:

[jdk directory]\jre\lib\rt.jar with debugging symbols, and
[jre directory]\lib\rt.jar with no debugging symbols

Gili