This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Don't randomly guess source filenames
- From: Andrew Haley <aph at redhat dot com>
- To: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 16 Mar 2007 17:27:28 +0000
- Subject: Don't randomly guess source filenames
We were guessing source filename based on classname. Unsurprisingly,
this often doesn't work, and we end up with a ton of nonexistent
filenames in our debuginfo. This confuses some tools.
Fixed thusly.
This doesn't destroy any real debuginfo, because as soon as we find a
SourceFile attribute in a .class file we use it. This removes
hundreds of bogus filenames, and AFAICS doesn't lose any real ones.
In the case of .class files with no debuginfo, we generate no
debuginfo for the corresponding object files.
Andrew.
2007-03-16 Andrew Haley <aph@redhat.com>
* class.c (push_class): Don't bogusly guess the source filename.
Index: class.c
===================================================================
--- class.c (revision 122746)
+++ class.c (working copy)
@@ -426,8 +426,7 @@
tree decl, signature;
location_t saved_loc = input_location;
#ifndef USE_MAPPED_LOCATION
- tree source_name = identifier_subst (class_name, "", '.', '/', ".java");
- input_filename = IDENTIFIER_POINTER (source_name);
+ input_filename = "<unknown>";
input_line = 0;
#endif
CLASS_P (class_type) = 1;