From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8111 invoked by alias); 31 Jul 2013 10:03:54 -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 8101 invoked by uid 89); 31 Jul 2013 10:03:54 -0000 X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_MED,RCVD_IN_HOSTKARMA_W,RDNS_NONE,SPF_PASS autolearn=ham version=3.3.1 Received: from Unknown (HELO e23smtp01.au.ibm.com) (202.81.31.143) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 31 Jul 2013 10:03:53 +0000 Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 31 Jul 2013 19:53:52 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 31 Jul 2013 19:53:50 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 45BA4357804E for ; Wed, 31 Jul 2013 20:03:39 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6V9lvEl33161246 for ; Wed, 31 Jul 2013 19:47:58 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r6VA3c21023902 for ; Wed, 31 Jul 2013 20:03:38 +1000 Received: from d23ml188.in.ibm.com (d23ml188.in.ibm.com [9.182.8.144]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r6VA3bTU023874; Wed, 31 Jul 2013 20:03:38 +1000 In-Reply-To: References: <51F69F1E.40808@redhat.com> Subject: Re: [PATCH 2/5] powerpc64-aix processing xlC generated line table X-KeepSent: 7E65CADF:3FE2B182-65257BB9:0036E94F; type=4; name=$KeepSent To: Raunaq 12 Cc: Pedro Alves , gdb-patches@sourceware.org, Mark Kettenis , tromey@redhat.com Message-ID: From: Raunaq 12 Date: Wed, 31 Jul 2013 10:03:00 -0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13073109-1618-0000-0000-000004603021 X-SW-Source: 2013-07/txt/msg00812.txt.bz2 Corrected a few formatting errors that i just realised :- --- ./gdb/xcoffread.c =================================================================== --- ./gdb.orig/xcoffread.c +++ ./gdb/xcoffread.c @@ -241,6 +241,8 @@ static struct linetable *arrange_linetable (struct linetable *); +static struct linetable *modify_xlc_linenos (struct linetable *); + static void record_include_end (struct coff_symbol *); static void process_linenos (CORE_ADDR, CORE_ADDR); @@ -589,6 +591,24 @@ } } +/* 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. */ + +static struct linetable * +modify_xlc_linenos (struct linetable *lineTb) +{ + int jj; + 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; + } + return lineTb; +} + /* Global variable to pass the psymtab down to all the routines involved in psymtab to symtab processing. */ static struct partial_symtab *this_symtab_psymtab; @@ -698,10 +718,14 @@ lv = main_subfile.line_vector; + /* Add extra line entry in case of xlc compiled binaries. */ + + lineTb = modify_xlc_linenos (lv); + /* Line numbers are not necessarily ordered. xlc compilation will put static function to the end. */ - lineTb = arrange_linetable (lv); + lineTb = arrange_linetable (lineTb); if (lv == lineTb) { current_subfile->line_vector = (struct linetable *) @@ -730,10 +754,14 @@ lv = (inclTable[ii].subfile)->line_vector; + /* Add extra line entry in case of xlc compiled binaries */ + + lineTb = modify_xlc_linenos (lv); + /* Line numbers are not necessarily ordered. xlc compilation will put static function to the end. */ - lineTb = arrange_linetable (lv); + lineTb = arrange_linetable (lineTb); push_subfile (); --- Regards, Raunaq