This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/5] powerpc64-aix processing xlC generated line table
- From: Pedro Alves <palves at redhat dot com>
- To: Raunaq 12 <raunaq12 at in dot ibm dot com>
- Cc: gdb-patches at sourceware dot org, tromey at redhat dot com, Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Date: Mon, 29 Jul 2013 17:58:06 +0100
- Subject: Re: [PATCH 2/5] powerpc64-aix processing xlC generated line table
- References: <OF2681EF63 dot 7B9300E1-ON65257BB7 dot 002254BD-65257BB7 dot 00225FAB at in dot ibm dot com>
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