This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Tweak gdb.trace/tfile.c for thumb mode
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <yao at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Wed, 09 Jul 2014 15:52:00 +0100
- Subject: Re: [PATCH] Tweak gdb.trace/tfile.c for thumb mode
- Authentication-results: sourceware.org; auth=none
- References: <1404100222-2312-1-git-send-email-yao at codesourcery dot com>
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