From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15606 invoked by alias); 25 Apr 2012 11:27:46 -0000 Received: (qmail 15596 invoked by uid 22791); 25 Apr 2012 11:27:45 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Apr 2012 11:27:32 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1SN0Nf-00037H-BZ from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 25 Apr 2012 04:27:31 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 25 Apr 2012 04:27:31 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Wed, 25 Apr 2012 04:27:30 -0700 Message-ID: <4F97DFEC.5030007@codesourcery.com> Date: Wed, 25 Apr 2012 13:13:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120412 Thunderbird/11.0.1 MIME-Version: 1.0 To: "Maciej W. Rozycki" CC: Subject: Re: [PATCH] microMIPS support References: In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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-04/txt/msg00858.txt.bz2 On 04/25/2012 04:29 AM, Maciej W. Rozycki wrote: > +int > +mips_pc_is_micromips (struct gdbarch *gdbarch, CORE_ADDR memaddr) > +{ > + struct minimal_symbol *sym; > + > + /* A flag indicating that this is a microMIPS function is stored by > + elfread.c in the high bit of the info field. Use this to decide > + if the function is microMIPS. Otherwise if bit 0 of the address > + is set, then ELF file flags will tell if this is a microMIPS > + function. */ > + sym = lookup_minimal_symbol_by_pc (memaddr); > + if (sym) > + return msymbol_is_micromips (sym); > + else > + return is_micromips_addr (gdbarch, memaddr); > +} Why don't we check `is_micromips_addr' first, and return early if it returns true? In this way, we can avoid some symbol lookups. -- Yao (齐尧)