From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2929 invoked by alias); 30 Jun 2008 14:00:39 -0000 Received: (qmail 2913 invoked by uid 22791); 30 Jun 2008 14:00:36 -0000 X-Spam-Check-By: sourceware.org Received: from igw3.br.ibm.com (HELO igw3.br.ibm.com) (32.104.18.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 30 Jun 2008 13:59:58 +0000 Received: from mailhub3.br.ibm.com (unknown [9.18.232.110]) by igw3.br.ibm.com (Postfix) with ESMTP id A0F52390111 for ; Mon, 30 Jun 2008 10:42:40 -0300 (BRST) Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.18.232.47]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m5UDswol3325966 for ; Mon, 30 Jun 2008 10:54:59 -0300 Received: from d24av02.br.ibm.com (loopback [127.0.0.1]) by d24av02.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m5UDsruq002310 for ; Mon, 30 Jun 2008 10:54:53 -0300 Received: from [9.18.203.182] ([9.18.203.182]) by d24av02.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m5UDsq2H002276 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Jun 2008 10:54:52 -0300 Subject: Re: [PATCH] Listing cpp source code in mainless binaries From: Luis Machado Reply-To: luisgpm@linux.vnet.ibm.com To: Daniel Jacobowitz Cc: gdb-patches@sourceware.org In-Reply-To: <20080626141754.GJ22726@caradoc.them.org> References: <1213122525.10042.148.camel@gargoyle> <20080626141754.GJ22726@caradoc.them.org> Content-Type: text/plain Date: Mon, 30 Jun 2008 14:13:00 -0000 Message-Id: <1214834098.21286.46.camel@gargoyle> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2008-06/txt/msg00587.txt.bz2 On Thu, 2008-06-26 at 10:17 -0400, Daniel Jacobowitz wrote: > On Tue, Jun 10, 2008 at 03:28:45PM -0300, Luis Machado wrote: > > - /* All right; find the last file in the symtab list (ignoring .h's). */ > > + /* All right; find the last file in the symtab list (ignoring .h's) > > + and namespace symtabs. */ > > That should be inside the parentheses :-) > > > @@ -260,7 +261,8 @@ > > { > > const char *name = s->filename; > > int len = strlen (name); > > - if (!(len > 2 && strcmp(&name[len - 2], ".h") == 0)) > > + if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0 > > + || strcmp (name, "<>") == 0))) > > current_source_symtab = s; > > } > > } > > > > Also, the same check is needed a few lines down. Otherwise OK. > Checked the following in with comment fixes. Thanks! Luis 2008-06-30 Luis Machado * source.c (select_source_symtab): Make sure we skip namespace symtabs when showing cpp source code. Index: gdb/source.c =================================================================== --- gdb.orig/source.c 2008-05-19 08:50:10.000000000 -0700 +++ gdb/source.c 2008-06-30 06:36:26.000000000 -0700 @@ -250,7 +250,8 @@ return; } - /* All right; find the last file in the symtab list (ignoring .h's). */ + /* Alright; find the last file in the symtab list (ignoring .h's + and namespace symtabs). */ current_source_line = 1; @@ -260,14 +261,15 @@ { const char *name = s->filename; int len = strlen (name); - if (!(len > 2 && strcmp(&name[len - 2], ".h") == 0)) + if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0 + || strcmp (name, "<>") == 0))) current_source_symtab = s; } } if (current_source_symtab) return; - /* Howabout the partial symbol tables? */ + /* How about the partial symbol tables? */ for (ofp = object_files; ofp != NULL; ofp = ofp->next) { @@ -275,7 +277,8 @@ { const char *name = ps->filename; int len = strlen (name); - if (!(len > 2 && strcmp (&name[len - 2], ".h") == 0)) + if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0 + || strcmp (name, "<>") == 0))) cs_pst = ps; } }