This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch:arm] Don't use NUM_PSEUDO_REGS in arm_gdbarch_init()
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Cc: gdb-patches at sources dot redhat dot com, Richard dot Earnshaw at arm dot com
- Date: Mon, 22 Apr 2002 12:07:19 +0100
- Subject: Re: [patch:arm] Don't use NUM_PSEUDO_REGS in arm_gdbarch_init()
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> Hello,
>
> The macro NUM_PSEUDO_REGS refers to ``current_gdbarch'' and not
> ``gdbarch''. Hence the equation in the patch was picking up the number
> of pseudo-registers from the previously selected architecture (which may
> not even be ARM), outch! No wonder macro's are bad :-)
>
> The attached calls gdbarch_num_pseudo_regs() directly with the correct
> architecture. (It also fixes a core dump that my next patch will cause ...)
>
> Committed as fairly obvious.
>
> Andrew
>
> 2002-04-20 Andrew Cagney <ac131313@redhat.com>
>
> * arm-tdep.c (arm_gdbarch_init): Use gdbarch_num_pseudo_regs
> instead of NUM_PSEUDO_REGS.
Argh! As you will see from the comment, I'd already fixed a similar
problem to avoid using SIZEOF_FRAME_SAVED_REGS, but missed that part. Can
you update the comment as well?
/* We can't use SIZEOF_FRAME_SAVED_REGS here, since that still
references the old architecture vector, not the one we are
building here. */
R.