This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

Re: [RFA] Clean up GAS line symbols for debugging assembly source


Alan Modra wrote:
> 
> On Fri, Nov 16, 2001 at 05:54:28PM -0800, Michael Snyder wrote:
> >
> > *** dwarf2dbg.c       2001/09/27 10:00:53     1.24
> > +   /* Don't emit sequences of line symbols for the same line. */
> > +   if (line == loc->line && filenum == loc->filenum)
> > +     return;
> > +
> > +   line = loc->line;
> > +   filenum = loc->filenum;
> 
> Hmm.  How does this play together with dwarf2dbg.c:877 ?
> 
>       /* Don't try to optimize away redundant entries; gdb wants two
>          entries for a function where the code starts on the same line as
>          the {, and there's no way to identify that case here.  Trust gcc
>          to optimize appropriately.  */
>       if (1 /* line != e->loc.line || changed */)
>         {

I think it's fair to say that they are orthogonal (unrelated).
My change affects only line symbols that are generated by gas itself.
The code that you point to above (and the associated comment) relate to
optimizing (or not optimizing) line symbols that are generated by gcc.
The change that I made will not affect line symbols that are generated
by gcc.


To elaborate -- when gas assembles the output of gcc, the line symbols
(generated by gcc) are already present.  Gcc decides where to put them, 
and gas merely passes them along.  In particular, gcc does not pass the
flag "-gdwarf2" to gas.

My change affects only line symbols that are created by gas, when gas
is given the "-gdwarf2" flag as it assembles an assembly source file.
This is done when a user wants to debug hand-written assembly language
as if it were high-level source.

The code that I changed is not invoked at all when gas is called by gcc.

I have also run this gas change thru the GDB testsuite.
There were no differences before vs. after.

Michael


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