From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12071 invoked by alias); 8 Mar 2012 22:39:31 -0000 Received: (qmail 11807 invoked by uid 22791); 8 Mar 2012 22:39:30 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,TW_SM,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vx0-f169.google.com (HELO mail-vx0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Mar 2012 22:39:16 +0000 Received: by vcbfk14 with SMTP id fk14so1006560vcb.0 for ; Thu, 08 Mar 2012 14:39:15 -0800 (PST) Received: by 10.52.180.38 with SMTP id dl6mr11537100vdc.105.1331246355718; Thu, 08 Mar 2012 14:39:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.180.38 with SMTP id dl6mr11537088vdc.105.1331246355592; Thu, 08 Mar 2012 14:39:15 -0800 (PST) Received: by 10.220.187.12 with HTTP; Thu, 8 Mar 2012 14:39:15 -0800 (PST) In-Reply-To: <4F5816EE.4050908@gmail.com> References: <4F54D758.8020508@gmail.com> <4F5816EE.4050908@gmail.com> Date: Thu, 08 Mar 2012 22:39:00 -0000 Message-ID: Subject: Re: [windows] patch to set breakpoint in a dll From: Doug Evans To: asmwarrior Cc: gdb-patches@sourceware.org, Chris Sutcliffe Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-Gm-Message-State: ALoCoQkSNkp/w7mG2E/yQ2b0ikpPpLHPkwKrNX1+qE7jhNLYdv7WorwZuk1JiuGMwWFvZ2omZQLSRYWDb+MrmQETHikDHEG+2dcjR5MK7eX3/6/BNMEAkreblBDCyeMQc/R02uaVtyT8ruiy1tWuD6omFunTWQWtQA== 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: 2012-03/txt/msg00300.txt.bz2 On Wed, Mar 7, 2012 at 6:18 PM, asmwarrior wrote: > On 2012-3-8 2:46, Doug Evans wrote: >> >> The patch has a few nits that need to be fixed, but I like the idea: > > Hi, Doug, Thanks for the reply. > >> have find_and_open_source consistently return the canonicalized path. >> However, openp (called by find_and_open_source later on) uses >> xfullpath, so for consistency I think that should be used here too >> instead of gdb_realpath. >> What do others think? > > By reading the function body of xfullpath, I see that it do more checks. > And transfer from gdb_realpath to xfullpath will adding an extra xmalloc and > xfree call. > > BTW: are there any simple way we can quickly check a path is cononicalized > or not, because even gdb_realpath have internally call xmalloc and xfree. > but once the *fullname is already cononicalized(after the first call of > find_and_open_source()), I think we can avoid calling any xmalloc and xfree. > Am I right? No such quick check is available, but I think we can ignore the cost of the xmalloc/xfree for this particular case until the data shows it's a problem.