status of ecj branch
Per Bothner
per@bothner.com
Wed Jun 21 16:16:00 GMT 2006
Andrew Haley wrote:
> Per Bothner writes:
> > Andrew Haley wrote:
> > > 3. ecj produces relative pathnames for source files, so gdb can't
> > > find any source.
> >
> > I suggest teaching ecj to emit SourceDebugExtension, as defined in
> > JSR-45. Eclipse may already support JSR-45. The main focus of
> > JSR-45 is to handle things like source-to-Java translators (such as JSP)
> > and include files, but it also includes a standard way to specify
> > full absoluete source filename.
> >
> > Kawa emits SourceDebugExtension, and in March 2005 I added support to
> > jcf-dump to print it sanely. For example kawa/lib/vectors.class:
> >
> > Attributes (count: 2):
> > Attribute "SourceFile", length:2, #352="vectors.scm"
> > Attribute "SourceDebugExtension", length:113
> > SMAP
> > vectors.scm
> > Scheme
> > *S Scheme
> > *F
> > + 1 vectors.scm
> > /home/bothner/Kawa/head/kawa/lib/vectors.scm
> > *L
> > 1#1,37:1
> > *E
>> I just built Kawa from svn head, and I get:
>> Attribute "SourceDebugExtension", length:66
> SMAP
> vectors.scm
> Scheme
> *S Scheme
> *F
> 1 vectors.scm
> *L
> 1#1,37:1
> *E
You'll get the extra line with the full pathname if you build Kawa
in a different directory than the source directory.
More generally, with Kawa emits is the source file name as specified
on the command line, not the fully-resolved file name. For example:
kawa -C foo/bar.scm
will emit:
+1 bar.scm
foo/bar.scm
What we also need is the current working directory.
One can assume that is the same as when ecj was run,
or emit the fully-qualified name in the SourceDebugExtension.
JSR-45 is a little unclear about this. The second line is
an AbsoluteFileName, but the example gives a relative file name.
"source path is a path name (often relative to one of the compilation
source paths)". But I don't see that they include the compilation
source path in the attribute, which seems losing.
There are arguments for both; gcc emits the relative file name,
plus separately the current working directory.
We may need to extend the SourceDebugExtension: another lack is
that there is no support for column numbers. (Though since gdb doesn't
handle column numbers, that's not very important.)
Maybe we should teach Eclipse about Dwarf debugging info ...
--
--Per Bothner
per@bothner.com http://per.bothner.com/
More information about the Java
mailing list