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: Andrew Cagney <ac131313 at cygnus dot com>
- To: Richard dot Earnshaw at arm dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: Mon, 22 Apr 2002 09:58:59 -0400
- Subject: Re: [patch:arm] Don't use NUM_PSEUDO_REGS in arm_gdbarch_init()
- References: <200204221107.MAA06332@cam-mail2.cambridge.arm.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?
M'kay.
> /* We can't use SIZEOF_FRAME_SAVED_REGS here, since that still
> references the old architecture vector, not the one we are
> building here. */
BTW, once the patch:
http://sources.redhat.com/ml/gdb-patches/2002-04/msg00711.html
goes through the problem should largely ``go away''.
Andrew