From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15247 invoked by alias); 10 Mar 2012 04:39:57 -0000 Received: (qmail 15238 invoked by uid 22791); 10 Mar 2012 04:39:56 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW 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; Sat, 10 Mar 2012 04:39:43 +0000 Received: by iajr24 with SMTP id r24so3650761iaj.0 for ; Fri, 09 Mar 2012 20:39:43 -0800 (PST) Received: by 10.60.20.6 with SMTP id j6mr1756699oee.17.1331354383183; Fri, 09 Mar 2012 20:39:43 -0800 (PST) Received: from [192.168.1.128] ([115.192.125.137]) by mx.google.com with ESMTPS id h9sm10345838obr.20.2012.03.09.20.39.38 (version=SSLv3 cipher=OTHER); Fri, 09 Mar 2012 20:39:41 -0800 (PST) Message-ID: <4F5ADB22.4050803@gmail.com> Date: Sat, 10 Mar 2012 04:39:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 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> In-Reply-To: Content-Type: multipart/mixed; boundary="------------060104020407070807050006" 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/msg00365.txt.bz2 This is a multi-part message in MIME format. --------------060104020407070807050006 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 306 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. --------------060104020407070807050006 Content-Type: text/x-c++; name="dll_bp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dll_bp.patch" Content-length: 788 gdb/source.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) 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; /* 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; + { + lpath = xfullpath(*fullname); + xfree(*fullname); + *fullname = lpath; + return result; + } /* Didn't work -- free old one, try again. */ xfree (*fullname); *fullname = NULL; --------------060104020407070807050006--