This is the mail archive of the
mailing list for the binutils project.
Re: [email@example.com: Re: PATCH: Output dwarf debug info only when needed]
On Wed, Jul 31, 2002 at 10:54:06AM +0100, Nick Clifton wrote:
> Hi Daniel,
> > Going through my 2.13 queue - could someone please review this
> > patch?
> > +++ gas/dwarf2dbg.c Tue Jun 11 14:41:25 2002
> > - /* If no debug information was recorded, nothing to do. */
> > - if (all_segs == NULL && files_in_use <= 1)
> > + /* If no debug information was recorded, nothing to do. Don't
> > + emit dwarf debug info for one ".file" directive only unless
> > + we are generating DWARF2 debugging info. */
> > + if (debug_type != DEBUG_DWARF2 && all_segs == NULL
> > + && files_in_use <= 2)
> > return;
> I think that the comment is rather confusing. How about this
> rewording ?
> + /* If no debug information was recorded, then we do not need
> + to do anything unless we are emitting DWARF2 line tables
> + or there was more than one input file. */
> + if (all_segs == NULL
> + && debug_type != DEBUG_DWARF2
> + && files_in_use <= 2)
> Also, shouldn't the test for the number of files be either
> "files_in_use <= 1" or "files_in_use < 2" ?
Actually, upon thinking about it, I think the files_in_use check should
be removed. The "first" file in GCC is numbered '1', which will make
files_in_use == 2. But even if there is more than one '.file'
directive, if there are no .loc directives I don't see how the
.debug_file section serves any purpose...
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer