This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 07/10] Share some ARM target dependant code from GDB with GDBServer.
- From: Pedro Alves <palves at redhat dot com>
- To: Antoine Tremblay <antoine dot tremblay at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Wed, 04 Nov 2015 19:56:03 +0000
- Subject: Re: [PATCH 07/10] Share some ARM target dependant code from GDB with GDBServer.
- Authentication-results: sourceware.org; auth=none
- References: <1446138583-13268-1-git-send-email-antoine dot tremblay at ericsson dot com> <1446138583-13268-8-git-send-email-antoine dot tremblay at ericsson dot com>
On 10/29/2015 05:09 PM, Antoine Tremblay wrote:
> This patch is in preparation for software single stepping support on ARM it
> shares some functions and defenitions that will be needed.
>
> No regressions, tested on ubuntu 14.04 ARMv7 and x86.
> With gdbserver-{native,extended} / { -marm -mthumb }
>
> Not tested : wince/bsd build.
Please make sure that --enable-targets=all still builds.
>
> gdb/ChangeLog:
>
> * arch/arm.c (bitcount): Move from arm-tdep.c
> (condition_true): Likewise.
> * arch/arm.h (Instruction Definitions): Move form arm-tdep.h.
> (condition_true): Move defenition from arm-tdep.h
> (bitcount): Likewise.
> * arm-tdep.c (condition_true): Move to arch/arm.c.
> (bitcount): Likewise.
> * arm-tdep.h (Instruction Definitions): Move to arch/arm.h.
> * arm-wince-tdep.c: Include arch/arm.h.
> * armnbsd-tdep.c: Likewise.
Missing a couple periods.
> +/* Returns true of the condition evaluates to true. */
s/of/if/ ?
> +
> +int
> +condition_true (unsigned long cond, unsigned long status_reg)
> +{
> +
> /* Addresses for calling Thumb functions have the bit 0 set.
> Here are some macros to test, set, or clear bit 0 of addresses. */
> #define IS_THUMB_ADDR(addr) ((addr) & 1)
> @@ -68,4 +98,10 @@ enum gdb_regnum {
> first halfword is INST1. */
> int thumb_insn_size (unsigned short inst1);
>
> +/* Returns true of the condition evaluates to true. */
Likewise.
> +int condition_true (unsigned long cond, unsigned long status_reg);
> +
> +/* Return number of 1-bits in VAL. */
> +int bitcount (unsigned long val);
These comments are duplicated though. The .c file's comments should
instead point to the .h file.
Thanks,
Pedro Alves