This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] microMIPS support


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 (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]