From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10650 invoked by alias); 29 Jul 2013 16:58:19 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 10641 invoked by uid 89); 29 Jul 2013 16:58:19 -0000 X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 29 Jul 2013 16:58:18 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6TGw82p003663 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 29 Jul 2013 12:58:08 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r6TGw60u001952; Mon, 29 Jul 2013 12:58:06 -0400 Message-ID: <51F69F1E.40808@redhat.com> Date: Mon, 29 Jul 2013 16:58:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Raunaq 12 CC: gdb-patches@sourceware.org, tromey@redhat.com, Mark Kettenis Subject: Re: [PATCH 2/5] powerpc64-aix processing xlC generated line table References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-07/txt/msg00722.txt.bz2 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