This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] microMIPS support
- From: Yao Qi <yao at codesourcery dot com>
- To: "Maciej W. Rozycki" <macro at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Wed, 25 Apr 2012 19:28:44 +0800
- Subject: Re: [PATCH] microMIPS support
- References: <alpine.DEB.1.10.1204241843340.19835@tp.orcam.me.uk>
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 (éå)