This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] ppc: include register numbers in gdbarch_tdep structure.
- From: Michael Snyder <msnyder at cygnus dot com>
- To: Elena Zannoni <ezannoni at cygnus dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Mon, 10 Dec 2001 11:30:40 -0800
- Subject: Re: [RFA] ppc: include register numbers in gdbarch_tdep structure.
- Organization: Red Hat, Inc.
- References: <15379.50110.429092.453327@krustylu.cygnus.com>
Elena Zannoni wrote:
> +++ ppc-bdm.c 2001/12/09 19:55:12
> @@ -200,8 +200,8 @@ bdm_ppc_fetch_registers (int regno)
> /* printf("Asking for register %d\n", first_regno); */
>
> /* if asking for an invalid register */
> - if ((first_regno == PPC_MQ_REGNUM) ||
> - ((first_regno >= FP0_REGNUM) && (first_regno <= FPLAST_REGNUM)))
> + if ((first_regno == gdbarch_tdep (current_gdbarch)->ppc_mq_regnum)
> + || ((first_regno >= FP0_REGNUM) && (first_regno <= FPLAST_REGNUM)))
[and many similar changes]
Not to be nit-picky, and I realize it's already been approved and
committed,
but wouldn't this code look prettier if we simply provided something
like:
#define PPC_MQ_REGNUM gdbarch_tdep (current_gdbarch)->ppc_mq_regnum