[hjl@lucon.org: Re: PATCH: Output dwarf debug info only when needed]

Nick Clifton nickc@redhat.com
Wed Jul 31 02:57:00 GMT 2002


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)
      return;

Also, shouldn't the test for the number of files be either
"files_in_use <= 1" or "files_in_use < 2" ?

Cheers
        Nick



More information about the Binutils mailing list