From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30286 invoked by alias); 12 Sep 2013 06:50:53 -0000 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 Received: (qmail 30277 invoked by uid 89); 12 Sep 2013 06:50:53 -0000 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Sep 2013 06:50:53 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.7 required=5.0 tests=AWL,BAYES_00,GARBLED_BODY,KHOP_THREADED,RDNS_NONE,SPF_HELO_FAIL autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1VK0jo-0005Sb-RJ from Yao_Qi@mentor.com ; Wed, 11 Sep 2013 23:50:48 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 11 Sep 2013 23:50:48 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Wed, 11 Sep 2013 23:50:47 -0700 Message-ID: <523163DF.3020707@codesourcery.com> Date: Thu, 12 Sep 2013 06:50:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Hui Zhu CC: Hui Zhu , gdb-patches ml Subject: Re: [PATCH] Fix gdb.base/shreloc.exp: (msymbol) relocated functions have different addresses fail in cygwin References: <522DD104.6090808@codesourcery.com> <52315FC6.4000005@mentor.com> In-Reply-To: <52315FC6.4000005@mentor.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00369.txt.bz2 On 09/12/2013 02:31 PM, Hui Zhu wrote: > -proc get_msym_addrs { var msymfile } { > +proc get_msym_addrs { var msymfile { plus_var "" } } { 'plus_var' is not good candidate for parameter name. I'd call it 'mst' or 'msym_type'. > # Extract the list of values for symbols matching var in the > # minimal symbol output file > > global gdb_prompt hex > set result "" > > - send_gdb "shell grep -E \" ${var}(\[ \t\]+.*)?\$\" ${msymfile}\n" > + if { "${plus_var}" == "" } { > + send_gdb "shell grep -E \" ${var}(\[ \t\]+.*)?\$\" ${msymfile}\n" > + } else { > + send_gdb "shell grep -E \" ${plus_var} .* ${var}(\[ \t\]+.*)?\$\" ${msymfile}\n" > + } This condition checking is not necessary, we can do send_gdb "shell grep -E \"${plus_var} ${var}(\[ \t\]+.*)?\$\" ${msymfile}\n" -- Yao (齐尧)