This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


2007-03-16  Andrew Haley  <>

	* 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;
-  tree source_name = identifier_subst (class_name, "", '.', '/', ".java");
-  input_filename = IDENTIFIER_POINTER (source_name);
+  input_filename = "<unknown>";
   input_line = 0;
   CLASS_P (class_type) = 1;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]