Bug 11623 - wrong debug file name info when compiling from .class (lacks directories)
Summary: wrong debug file name info when compiling from .class (lacks directories)
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: wrong-debug
Depends on:
Reported: 2003-07-21 20:15 UTC by Tom Tromey
Modified: 2016-09-30 22:48 UTC (History)
2 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2005-04-30 15:54:51


Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2003-07-21 20:15:50 UTC
A java .class file only contains the base name of its
corresponding source file.  gcj copies this verbatim
into the resulting object file.

This means that when debugging with gdb I have to
add a large number of directories to the search path
to find all the .java files (in my scenario I can
only compile from .class files)

I think it would be useful if gcj instead prepended
the class' package, considered as a directory tree.

For example, if I compile "org/foo/bar/Doit.class",
right now gdb will end up looking for "Doit.java".
I'd prefer it to look for "org/foo/bar/Doit.java".

This isn't perfect, but it would greatly reduce the
number of "dir" commands I have to run, at least for
the most common way to structure java packages.
Comment 1 Nathanael C. Nerode 2003-07-21 22:41:55 UTC
Comment 2 Andrew Pinski 2003-11-23 07:08:19 UTC
I think is a bad bug which should be fixed for 3.4, right?
Comment 3 Tom Tromey 2003-11-23 19:18:31 UTC
I'm unsetting the target milestone again.

This is annoying, but it isn't a regression and there is a known
workaround -- just enter a lot of "dir" commands in gdb.

There are worse java debuginfo bugs out there, namely
Bug 6587.
Comment 4 Andrew Pinski 2016-09-30 22:48:50 UTC
Closing as won't fix as the Java front-end has been removed from the trunk.