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] Tweak gdb.trace/tfile.c for thumb mode


On 06/30/2014 04:50 AM, Yao Qi wrote:
> +  /* Although the thumb functions are two-bytes aligned, ld sets the
> +     bit 0 of these function references.  Clear the bit 0.  */
> +#if defined(__thumb__) || defined(__thumb2__)
> +  func_addr &= ~1;
> +#endif

I suggest putting the comment within the #if block, and write:

#if defined(__thumb__) || defined(__thumb2__)
  /* Although Thumb functions are two-byte aligned, function
     pointers have the Thumb bit set.  Clear it.  */
  func_addr &= ~1;
#endif

(This bit is widely known as the "Thumb bit", so call it that,
and remove a few "the"'s that sound odd to me, and say
"two-byte aligned".)

Otherwise looks good.

Thanks,
-- 
Pedro Alves


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