From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18077 invoked by alias); 16 Mar 2012 01:52:23 -0000 Received: (qmail 18069 invoked by uid 22791); 16 Mar 2012 01:52:21 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_SM X-Spam-Check-By: sourceware.org Received: from mail-iy0-f169.google.com (HELO mail-iy0-f169.google.com) (209.85.210.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Mar 2012 01:52:07 +0000 Received: by iajr24 with SMTP id r24so5555998iaj.0 for ; Thu, 15 Mar 2012 18:52:06 -0700 (PDT) Received: by 10.42.108.199 with SMTP id i7mr413348icp.46.1331862726880; Thu, 15 Mar 2012 18:52:06 -0700 (PDT) Received: from [192.168.1.100] ([125.118.51.116]) by mx.google.com with ESMTPS id cw5sm2652407igc.17.2012.03.15.18.52.02 (version=SSLv3 cipher=OTHER); Thu, 15 Mar 2012 18:52:05 -0700 (PDT) Message-ID: <4F629CE5.8030301@gmail.com> Date: Fri, 16 Mar 2012 01:52:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20120312 Thunderbird/11.0 MIME-Version: 1.0 To: Doug Evans CC: gdb-patches@sourceware.org, Chris Sutcliffe Subject: Re: [windows] patch to set breakpoint in a dll References: <4F54D758.8020508@gmail.com> <4F5816EE.4050908@gmail.com> <20120314182606.F20822461B2@ruffy.mtv.corp.google.com> In-Reply-To: <20120314182606.F20822461B2@ruffy.mtv.corp.google.com> Content-Type: multipart/mixed; boundary="------------080102080705090105020109" 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/msg00584.txt.bz2 This is a multi-part message in MIME format. --------------080102080705090105020109 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 2424 On 2012-3-15 2:26, Doug Evans wrote: > On Fri, Mar 9, 2012 at 8:40 PM, asmwarrior wrote: >> On 2012-3-9 6:39, Doug Evans wrote: >>> 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. >> Ok, this is the modified patch.(simply replace gdb_fullpath with xfullpath) >> It works Ok under mingw+windowsXP. > Thanks. > This needs a ChangeLog entry of course. > Something like > > 2012-03-14 Zhang Yuanhui > > * source.c (find_and_open_source): Consistently pass resulting > full path through xfullpath. > > Further comments inline with the patch. > > diff --git a/gdb/source.c b/gdb/source.c > index cfdf81b..cd87e34 100644 > --- a/gdb/source.c > +++ b/gdb/source.c > @@ -979,6 +979,7 @@ find_and_open_source (const char *filename, > char *path = source_path; > const char *p; > int result; > + char *lpath; > > Move this declaration into the block where it is used. > > /* Quick way out if we already know its full name. */ > > @@ -997,7 +998,12 @@ find_and_open_source (const char *filename, > > result = open (*fullname, OPEN_MODE); > if (result>= 0) > - return result; > + { > > Add a comment here explaining why we're calling xfullpath. > E.g., > /* Call xfullpath here to be consistent with openp > which we use below. */ > > + lpath = xfullpath(*fullname); > + xfree(*fullname); > > Space before '('. > Plus, for consistency, I think the indentation here should use tabs. > > + *fullname = lpath; > + return result; > + } > /* Didn't work -- free old one, try again. */ > xfree (*fullname); > *fullname = NULL; > > > Ok with those changes. > Thanks! Ok, this is the new patch.(I have problem using the TortoiseGit to generate a diff between two revisions.you can see, the file name is long and dirty) Also, the log message is what you wrote: 2012-03-14 Zhang Yuanhui * source.c (find_and_open_source): Consistently pass resulting full path through xfullpath. My family name is "Zhang", so I'm not sure it should be put before the given name or after the given name. The Chinese name and English name have different formats. Thanks. --------------080102080705090105020109 Content-Type: text/x-c++; name="bp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bp.patch" Content-length: 704 diff --git "a/C:\\Temp\\sou4C.tmp\\source-765c91-left.c" "b/C:\\Temp\\sou49.tmp\\source-e835db-right.c" index cfdf81b..1293b38 100644 --- "a/C:\\Temp\\sou4C.tmp\\source-765c91-left.c" +++ "b/C:\\Temp\\sou49.tmp\\source-e835db-right.c" @@ -996,8 +996,16 @@ find_and_open_source (const char *filename, } result = open (*fullname, OPEN_MODE); + /* Call xfullpath here to be consistent with openp + which we use below. */ if (result >= 0) + { + char *lpath; + lpath = xfullpath (*fullname); + xfree (*fullname); + *fullname = lpath; return result; + } /* Didn't work -- free old one, try again. */ xfree (*fullname); *fullname = NULL; --------------080102080705090105020109--