From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12154 invoked by alias); 14 Mar 2012 18:26:22 -0000 Received: (qmail 12142 invoked by uid 22791); 14 Mar 2012 18:26:21 -0000 X-SWARE-Spam-Status: No, hits=-2.3 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-yw0-f73.google.com (HELO mail-yw0-f73.google.com) (209.85.213.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Mar 2012 18:26:08 +0000 Received: by yhpp61 with SMTP id p61so333909yhp.0 for ; Wed, 14 Mar 2012 11:26:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=to:cc:in-reply-to:references:subject:message-id:date:from :x-gm-message-state; bh=yEpU6BqqHKRSdCbtQS/R3c4XdSEUSGt5Ot+Fg5f8Hpo=; b=m2Ut7ELbfa9E3SK0OtI6jcM7nLQ6zPKqQn/6lrRVlo5i4VO/RXksB8RtExQHB8zdVb fr7gYd/XpVL/6ROgSFb6TuB8I7o51diS+Bo/une95LJdsocb+KDZWcZfCasH9zJ6dvbP 5VUTxR8qlDWTF8ZeIFDa6Qg2TjP5kqqWBxtQMlbcmA89ks/ESsCMILQzaGDgoLP550F5 kqmLEIyEojml+puVK2NLueXbPq2R57tTgSqG4WtcvGFLh7lVgQ5o03jA7Rg0TTbzV1Gp lKAV+Dv9jI5NRvVM9y/BTDLgCOFLlMU5Z6Ut9IpV80l0W8xb+++y7vWu8j78/nNu9IQr axbA== Received: by 10.236.139.199 with SMTP id c47mr4729747yhj.5.1331749567485; Wed, 14 Mar 2012 11:26:07 -0700 (PDT) Received: by 10.236.139.199 with SMTP id c47mr4729728yhj.5.1331749567408; Wed, 14 Mar 2012 11:26:07 -0700 (PDT) Received: from wpzn4.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id g10si2612360yhn.7.2012.03.14.11.26.07 (version=TLSv1/SSLv3 cipher=AES128-SHA); Wed, 14 Mar 2012 11:26:07 -0700 (PDT) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.18.110.50]) by wpzn4.hot.corp.google.com (Postfix) with ESMTP id 4DF761E004D; Wed, 14 Mar 2012 11:26:07 -0700 (PDT) Received: by ruffy.mtv.corp.google.com (Postfix, from userid 67641) id F20822461B2; Wed, 14 Mar 2012 11:26:06 -0700 (PDT) To: asmwarrior cc: gdb-patches@sourceware.org, Chris Sutcliffe In-Reply-To: <4F5ADB22.4050803@gmail.com> References: <4F54D758.8020508@gmail.com> <4F5816EE.4050908@gmail.com> Subject: [windows] patch to set breakpoint in a dll Message-Id: <20120314182606.F20822461B2@ruffy.mtv.corp.google.com> Date: Wed, 14 Mar 2012 18:26:00 -0000 From: dje@google.com (Doug Evans) X-Gm-Message-State: ALoCoQny22OmisaYh0+PZK97fRz95YBAX+8ZwtcYjJsdUSMIhJCyFDUBVptFIbO9Qep0sqnIEgVskYYBkRx3Kp1ZM6wiOWdD3Dttmo5IIGNzDeYO3gFSJHDSnN3onGWU2PIO9PHnXJlg/4djY+A0onjqfVh8+GAMZp4v3MoQhQhLbdlRcIylcXs= 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/msg00498.txt.bz2 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!