[PATCH] microMIPS support

Yao Qi yao@codesourcery.com
Wed Apr 25 13:13:00 GMT 2012


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 (齐尧)



More information about the Gdb-patches mailing list