This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [PATCH 2/5] powerpc64-aix processing xlC generated line table


On 07/29/2013 07:15 AM, Raunaq 12 wrote:
> +      /* xlc compiled binaries have one less entry in the line table.
> +         So the function entry lines marked as line number equal to 0
> +         will be retained in the line table with line numbers equal
> +         to its succeeding line table entry. */
> +
> +      lineTb = lv;
> +
> +      for (jj = 0; jj < lineTb->nitems; jj++)
> +        {
> +          if (lineTb->item[jj].line == 0 && (lineTb->item[jj].pc
> +			             != lineTb->item[jj + 1].pc))
> +                    lineTb->item[jj].line = lineTb->item[jj + 1].line;
> +        }
> +

...

> 
> +          /* xlc compiled binaries have one less entry in the line table.
> +             So the function entry lines marked as line number equal to 0
> +             will be retained in the line table with line numbers equal
> +             to its succeeding line table entry. */
> +
> +          lineTb = lv;
> +
> +          for (jj = 0; jj < lineTb->nitems; jj++)
> +            {
> +              if (lineTb->item[jj].line == 0 && (lineTb->item[jj].pc
> +				 != lineTb->item[jj + 1].pc))
> +                    lineTb->item[jj].line = lineTb->item[jj + 1].line;
> +            }

Seems to me this duplicate code could/should be factored out to a helper
function.

-- 
Pedro Alves


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