From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31899 invoked by alias); 26 Sep 2008 04:15:15 -0000 Received: (qmail 31889 invoked by uid 22791); 26 Sep 2008 04:15:14 -0000 X-Spam-Check-By: sourceware.org Received: from yw-out-1718.google.com (HELO yw-out-1718.google.com) (74.125.46.158) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 26 Sep 2008 04:14:32 +0000 Received: by yw-out-1718.google.com with SMTP id 9so223838ywk.48 for ; Thu, 25 Sep 2008 21:14:30 -0700 (PDT) Received: by 10.150.206.11 with SMTP id d11mr1186974ybg.168.1222402470027; Thu, 25 Sep 2008 21:14:30 -0700 (PDT) Received: from ?192.168.1.2? ( [201.82.215.197]) by mx.google.com with ESMTPS id 6sm1476184ywc.9.2008.09.25.21.14.27 (version=SSLv3 cipher=RC4-MD5); Thu, 25 Sep 2008 21:14:28 -0700 (PDT) Message-ID: <48DC61B9.2070603@br.ibm.com> Date: Fri, 26 Sep 2008 04:15:00 -0000 User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Francois Rigault CC: gdb-patches@sourceware.org Subject: Re: [Patch] Improve path lookup of absolute source file References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit From: Thiago Jung Bauermann 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-09/txt/msg00510.txt.bz2 Hi, Francois Rigault schrieb: > On a slow IO filesystem, like a network file system, this can slow down > the performances. gdb takes here 15s to complete the setting of the > first breakpoint on an absolute source file path. > > In order to let gdb find the files without generating IOs, a simple > trick is to check that symbol source file and target source file have > the same basename, as source file used at compilation time and the one > used for debugging are unlikely to have different basenames. See the > patch below against gdb-6.8. This patch is a good idea, thanks. Some comments: We need it against current CVS HEAD of GDB. Also, could you run the testsuite before and after applying your patch, to be sure it introduces no regression? It doesn't seem to me it will, but this is good practice anyway. Also, some nits regarding formatting, since GDB uses the GNU Coding Standard: > *** gdb/symtab.c Thu Sep 11 11:10:13 2008 > --- gdb/symtab.c Thu Sep 11 11:31:46 2008 > *************** lookup_partial_symtab (const char *name) > *** 259,264 **** > --- 259,270 ---- > return (pst); > } > > + /* Skip this symbol if basenames differ. */ s/symbol/symbol table/ Also, you need two spaces after the full stop. > + if (FILENAME_CMP (lbasename(name), lbasename(pst->filename)) != 0) There should be a space between the function name and the parenthesis. > + { > + continue; > + } You don't need the curly braces here, since there's only one statement inside the if. -- []'s Thiago Jung Bauermann IBM Linux Technology Center